can someone please do this program using C not C++ thank you very much in advanc
ID: 3677930 • Letter: C
Question
can someone please do this program using C not C++ thank you very much in advance :)
High Adventure Travel Agency
The High Adventure Travel agency offers four vacation packages for thrill-seeking customers. The rates and options vary for each package. You’ve been asked to write a program to calculate and itemize the charges for each package, which are described below:
Devil’s Courthouse Adventure Weekend: An action packed three day weekend spent camping, rock climbing, and rappelling at Devil’s Courthouse, North Carolina. This getaway is for novices and experts alike. Climbing instructors are available to beginners at an optional low price. Camping equipment rental is also available.
Rate:
Base Charge: $350 per person
Climbing Instruction: $100 per person
Equipment Rental: $40/day per person
Scuba Bahama: A week long cruise to the Bahamas with three days of scuba diving. Those with prior experience may dive right in, while beginners should choose to take optional, but very affordable lessons.
Rate:
Base Charge: $1000 per person
Scuba Instruction: $100 per person
Sky Dive Colorado: Four thrilling days with expert sky diving instructors in Colorado Springs CO. For lodging, you may choose either the Wilderness Lodge or the Luxury Inn. (Instruction is included for all members of the party).
Rate:
Base Charge: $700 per person
Lodging at Wilderness Lodge: $65/day per person
Lodging at Luxury Inn $120/day per person
Barron Cliff Spelunk: Eight days spent hiking and exploring caves in the Barron Cliff Wilderness Area, Tennessee. Camping equipment rental is available.
Rate:
Base Charge: $700 per person
Equipment Rental: $40/day per person
Note: A 10% discount is provided on the base charges of any package for a party of five or more.
Create the following functions to be used in this program:
main( ) : Calls the menu function and dispatches program control to the appropriate module, based upon the user’s choice of packages
menu( ): Displays a menu listing the vacation packages. Allows the user to enter a selection, which is returned to the main function
char menu( );
climbing( ): Asks user for information necessary to calculate charges for the Devil’s Courthouse Adventure Weekend package
double climbing( );
scuba( ): Asks user for information necessary to calculate charges for the Scuba Bahama package
double scuba( );
skyDive( ): Asks the user for information necessary to calculate charges for the Sky Dive Colorado package
double skyDive( );
spelunk( ): Asks the user for information necessary to calculate charges for the Barron Cliff Spelunk package
double spelunk();
Write a program to achieve the program functions as described above. Remember the following points:
(a) The function prototypes are provided. Use these prototypes to write the implementation
(b) Build the program one function at a time, testing each function as you go
(c) Note that most of the functions are void( ) …what does this mean about the display of the function calculations
(d) Label your input and output fields neatly and control the output to provide a finished appearance
Explanation / Answer
#include <iostream>
#include <iomanip>
using namespace std;
const double CLIMB_RATE = 350.0;
const double SCUBA_RATE = 1000.0;
const double SKY_DIVE_RATE = 400.0;
const double CAVE_RATE = 700.0;
const double CLIMB_INSTRUCT = 100.0;
const double SCUBA_INSTRUCT = 100.0;
const double DAILY_CAMP_RENTAL = 40.0;
const double DAY_LODGE_1 = 65.0;
const double DAY_LODGE_2 = 120.0;
void climbing();
void scuba();
void skyDive();
void spelunk();
int menu();
int main()
{
int selection;
cout << fixed << showpoint << setprecision(2);
do
{
selection = menu();
switch(selection)
{
case 1 : climbing();
break;
case 2 : scuba();
break;
case 3 : skyDive();
break;
case 4 : spelunk();
break;
case 5 : cout << "Exiting program. ";
}
}
while (selection != 5);
return 0;
int menu()
{
int choice;
cout << "High Adventure Travel Agency ";
cout << "---------------------------- ";
cout << "1) Devil's Courthouse Adventure Weekend ";
cout << "2) Scuba Bahama ";
cout << "3) Sky Dive Colorado ";
cout << "4) Barron Cliff Spelunk ";
cout << "5) Exit Program ";
cout << "Enter 1, 2, 3, 4, or 5: ";
cin >> choice;
while (choice < 1 || choice > 5)
{
cout << "Invalid Selection. Enter 1, 2, 3, 4, or 5: ";
cin >> choice;
}
return choice;
}
void climbing()
{
int beginners, advanced,needEquip;
double baseCharges,charges, instruction, equipment, discount = 0,deposit;
cout << " Devil's Courthouse Adventure Weekend ";
cout << "------------------------------------ ";
cout << "How many will be going who need an instructor? ";
cin >> beginners;
cout << "How many advanced climbers will be going? ";
cin >> advanced;
cout << "How many will rent camping equipment? ";
cin >> needEquip;
baseCharges = (beginners + advanced) * CLIMB_RATE;
charges = baseCharges;
}
if ((beginners + advanced) > 4)
{
discount = (charges * .1);
charges -= discount;
}
instruction = beginners * CLIMB_INSTRUCT;
charges += instruction;
equipment = needEquip * DAILY_CAMP_RENTAL * 4;
charges += equipment;
deposit = charges / 2.0;
cout << "Number in party: " << (beginners + advanced);
cout << endl;
cout << "Base charges: $" << baseCharges << endl;
cout << "Instruction cost: $" << instruction << endl;
cout << "Equipment Rental: $" << equipment << endl;
cout << "Discount: $" << discount << endl;
cout << "Total Charges: $" << charges << endl;
cout << "Required Deposit: $" << deposit << endl << endl;
}
void scuba()
{
int beginners, advanced;
double baseCharges, charges,instruction, discount = 0, deposit;
cout << " Scuba Bahama ";
cout << "------------------------------------ ";
cout << "How many will be going who need an instructor? ";
cin >> beginners;
cout << "How many advanced scuba divers will be going? ";
cin >> advanced;
baseCharges = (beginners + advanced) * SCUBA_RATE;
charges = baseCharges;
if ((beginners + advanced) > 4)
{
discount = (charges * .1);
charges -= discount;
}
instruction = beginners * SCUBA_INSTRUCT;
charges += instruction;
deposit = charges / 2.0;
cout << "Number in party: " << (beginners + advanced);
cout << endl;
cout << "Base charges: $" << baseCharges << endl;
cout << "Instruction cost: $" << instruction << endl;
cout << "Discount: $" << discount << endl;
cout << "Total Charges: $" << charges << endl;
cout << "Required Deposit: $" << deposit << endl << endl;
}
void skyDive()
{
int party,lodge1, lodge2;
double baseCharges, charges,discount = 0, lodging, deposit;
cout << " Sky Dive Colorado ";
cout << "------------------------------------ ";
cout << "How many will be going? ";
cin >> party;
baseCharges = party * SKY_DIVE_RATE;
charges = baseCharges;
if (party > 4)
{
discount = (charges * .1);
charges = discount;
}
cout << "How many will stay at Wilderness Lodge? ";
cin >> lodge1;
cout << "How many will stay at Luxury Inn? ";
cin >> lodge2;
lodging = (lodge1 * DAY_LODGE_1) + (lodge2 * DAY_LODGE_2);
charges += lodging;
deposit = charges / 2.0;
cout << "Number in party: " << party << endl;
cout << "Base charges: $" << baseCharges << endl;
cout << "Lodging: $" << lodging << endl;
cout << "Discount: $" << discount << endl;
cout << "Total Charges: $" << charges << endl;
cout << "Required Deposit: $" << deposit << endl << endl;
}
void spelunk()
{
int party,
needEquip;
double baseCharges,charges, equipment, discount = 0, deposit;
cout << " Barron Cliff Spelunk Weekend ";
cout << "------------------------------------ ";
cout << "How many will be going? ";
cin >> party;
cout << "How many will rent camping equipment? ";
cin >> needEquip;
baseCharges = party * CAVE_RATE;
charges = baseCharges;
if (party > 4)
{
discount = (charges * .1);
charges -= discount;
}
equipment = needEquip * DAILY_CAMP_RENTAL * 4;
charges += equipment;
deposit = charges / 2.0;
cout << "Number in party: " << party << endl;
cout << "Base charges: $" << baseCharges << endl;
cout << "Equipment Rental: $" << equipment << endl;
cout << "Discount: $" << discount << endl;
cout << "Total Charges: $" << charges << endl;
cout << "Required Deposit: $" << deposit << endl << endl;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.