Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C++

please let someone who can answer both parts thanks. And explain you answer also mark both parts.

 

The Project requires you to the pseudocode of a two-part application. Inthis case  Part one is required to complete part two.

Here is the scenario and requirements for Part One:

You have been hired as a programmer for Leading for Leaders, a professional development organization. Leading for Leaders is offering four different retreats, each with various rates and options. You will write a program to calculate and itemize the charges for each retreat:The Ron Burgundy People Know Me Retreat:

Base charge = $350 per person

Leadership instruction = $100 per person

Required equipment = $40 per person

The Michael Scott World's Best Boss Retreat:

Base charge = $1000 per person

Leadership instruction = $100 per person

Dr. Cox Presents Man Not Caring Retreat:

Base charge = $400 per person

Lodging = $65/day per person

Luxury lodging = $120/day per person

Tony Johnson's I Really Don't Care Retreat:

Base charge = $700 per person

Equipment = $40/day per person

There will need to be a global constant defined for each rate (Ex: RON_BASE = 350.0, MICHAEL_BASE = 1000.0)

There will need to be a total of 6 functions defined:

main

menu

burgundy

scott

cox

johnson

The number in each party, broken down by beginner and advanced, needs to be captured as well as how many in each party require equipment.

Function Description
main Calls menu and dispatches control to the appropriate function based on user choice of retreat.
menu Displays a menu listing each retreat. User selections are returned to main.
burgundy Calculates charges for The Ron Burgundy People Know Me Retreat.
scott Calculates charges for The Michael Scott World's Best Boss Retreat.
cox Calculates charges for the Dr. Cox Presents Man Not Caring Retreat.
johnson Calculates charges for the Tony Johnson's I Really Don't Care Retreat.

You should write pseudocode for six (6) functions.

 

Here is the scenario and requirements for Part Two:

You will modify the application you developed in Part One by keeping a file of the retreats sold. Data structures will hold the data about each retreat.

Part One used functions to process each retreat and the functions kept data in local variables.

Part Two requires new data structures to replace local variable definitions with structure declarations.

Once the structures are created, a record is stored in a file each time a retreat is sold. Each record records the data on a single retreat and the data structures can be combined into a union.

Here are some important details for the modification:

Reservation structure needs to be created to store a retreatNum variable identifying the number for the retreat the structure holds data for.

Reservation will represent any of the four retreats.

Function main will define the Reservation variable group, which is passed by reference to the burgundy, scott, cox, or johnson function depending upon the retreat a user chooses.

Each function will require modification for Reservation and group.

group.retreatNum will store the retreat number and which union structure will hold data for the retreat.

group.retreats.burgundy.beginners (for example) will store the number of beginners in each party.

Let's use The Ron Burgundy People Know Me Retreat as an example: Details

Base charge = $350 per person

Leadership instruction = $100 per person

Required equipment = $40 per person

Part One function:

int beginners, //Those needing instruction
advanced, //Those not needing
instruction
needEquip; //Those needing equipment

double baseCharges, //Base charges
charges, //Total charges
instruction, //Instruction cost
equipment; //Equipment cost

Here is an example of the new data structure for Part Two:

struct Retreat1 //Burgundy retreat
{
int num; //Number in party
int beginners; //Need instruction
int advanced; //No instruction
int needEquip; //Needs equipment
double baseCharges,
double charges;
double instruction;
double equipment;
};

Here is an example of the union:

union Retreat
{
struct Retreat1 burgundy;
// remaining retreats
};

Finally, a variable needs to be created to identify which retreat a structure holds data for:

struct Reservation
{
int retreatNum;
union Retreat retreats;
};

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education