89 924
Assignments Done
99.4%
Successfully Done
In September 2020

# Answer to Question #29425 in C++ for kaka

Question #29425
Write a program for calculation of the total price of package of vacation. There are 3 destination : New Zealand, Korea, Japan. The rate of accommodation for New Zealand is 80 per day, Korea is 100 per day, Japan is 110 per day. For New Zealand, child will be charge 10,adult 20, for Korea child will be charge 20,adult 30, for Japan child will be charge 30,adult 40. Write c++ program that ask user to enter name, number of child,number of adult,accommodation and total price.
1
2013-05-02T10:59:14-0400
#include <iostream>
#include <string>
using namespace std;

enum { //constans
NZ_Accomm= 80,
K_Accomm = 100,
J_Accomm = 110,

NZ_Child= 10,

K_Child = 20,

J_Child = 30,
};

int main() {
cout<< "enter name of vacation: ";
stringname;
cin>> name;
cout<< "enter number of child: ";
intchildren;
cin>> children;
cout<< "enter number of adult: ";
cout<< "enter number of accommodation days: ";
intdays;
cin>> days;
inttotal_price = 0;
boolok_name = true;
if(name.compare("New Zealand") == 0) { //new zealand
}else if (name.compare("Korea") == 0) {
}else if (name.compare("Japan") == 0) {
}else {
ok_name= false;
}
if(ok_name) {
cout<< "Total price: " << total_price << endl;
}else {
cout<< "wrong name
";
}
return0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!