Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

You are to create a C++ program that enables a person to make

 
active1065's Avatar
  • Answered by:active1065
  • Software Engineer
  • Positive Feedback: 100.0 %
  • Accepted Answers: 38
Verified Expert
in Programming

Recent Feedback

Positive
A+++
Positive
Thank you!
Positive
Thanks for being patiennt with me!
Positive
Quick, nice and professional. I am so happy with how this went.
Positive
Good programmer
Positive
Good job. and easy to work with.
Positive
Good programmer
Positive
Thanks for taking the time to break down the steps to me. Great Work. I...
Positive
worked hard on this. many thanks!
Positive
Good programmer

Customer Question

You are to create a C++ program that enables a person to make a reservation at the Cancun Mexican Resort.

1. The program should be controlled by a main loop that lets the user answer Y or N to the question,
• “Do you want to make another reservation? Y/N” If they answer with a lower case y or a capital Y, the program continues, else the program ends.
2. Next, a menu as shown below should be displayed using a do while loop.
Before the menu is displayed, use the system (“cls”) command to clear the screen so the menu comes up nice and clean.

Welcome to the Cancun Mexicana Resort!
Please select the room type of your choice
*****************************************************
1. King Suite ($280.00)
2. 2 Queen Beds Suite ($310.00)
3. King Standard Room ($235.00)
4. 2 Queen Beds Standard Room ($255.00)
*****************************************************

• If the user enters anything outside the range of 1-4, they should get a message to that effect and be required to enter the menu option again. They should not be able to proceed with the rest of the program until they have entered the correct information.
3. Once they correctly enter one of the menu numbers, they should be asked for the number of nights.
• Please enter the number of nights. Must be greater than 0.
• If the number entered is not greater than 0 then tell the user this and do not let them continue until they have entered a number greater than 0.
4. Next ask them to enter the currency type.
• Please enter the currency type: A for American or P for Pesos
• If the currency type is not an a or p, make them enter it again until they enter an a or a p. It should not matter if the currency type is a capital a or p.
5. Next ask them if they need ground transportation.
• Do you need ground transportation Y/N? Bus available for 15.00 day
o If they do not enter a y or n, do not let them continue until they enter the correct letter.
• If they answer y or Y, ask them for the number of days.
o How many days do you want transportation - must be greater than zero?
o If the number entered is not greater than zero, force them to stay there until the number entered is greater than zero.
6. Next you ask them if they want a bus tour?
Do you want a bus tour Y/N? Available daily 10.00
Again, validate to make sure they answer with a y or n.
If Y or y, the bus tour total of 10.00 will be included in a variable.
Calculations & Functions
7. Room rate amounts (280.00, 310.00, 235.00 and 255.00) and tax (.15) should be declared as constants.
8. Using a switch structure use the menu options as the case numbers. Example, case 1 would be King Suite($280.00) and so on. This structure should determine the room fee and the room type based on the menu option.
9. Call the function getRoomTotal where you will send the room fee, the currency type (a or P) and the number of nights
• If the currency type is an A or a,
room total = room price * number of nights * 1
• If the currency type if a P or p,
room total = room price * number of nights * 10.5644.
**Note** We are using 10.5644 as the currency conversion rate for Pesos. At any one time it could change. We are using this rate because it keeps everyone’s programs consistent.
10. Get the final total by calling a function called getFinalTotal. You need to pass the variables that include the room total, tax, days of transportation and if they are going on a bus tour.
• In the function, getTotal you will be using the following calculations.
• Calculate the room tax by multiplying the room total * .15
o If the variable for bus tour is a y or Y,
final total is equal to room total+ room tax + days of transportation times 15.00 plus 10.00.
o If the variable for bus tour is not equal to y or Y,
final total = room total+room tax+days of transportation times 15.00
11. Display the reservation information by calling a function called displayInformation. You will pass the number of days, room total, room tax, days of transportation, bus tour, room type , final total, currency type.

The final results should be displayed as follows:
**************************************************************************
Number days you are staying: 2
Room Type: King Suite
Currency type: American
Tax on room only: 84.00
Room Total only: 560.00
____________________________________________________
Transportation Cost: 30.00
Bus tour: 10.00
____________________________________________________
Total: 684.00

• After this function you should ask the user if they would like to make another reservation.
• The initial variables should be reset to their initial values so the user can enter another reservation.

 

Optional Information:
Language (or Software): C++
Browser (if necessary): Chrome

Already Tried:
#include #include #include using namespace std; int main() { // Declare variables int roomType; // Output welcome message cout << "Welcome to the Cancun Mexican Resort!"<< endl; cout << "\n***************************************** \n1. King Suite ($280.00) "; cout << "\n2. 2 Queen Beds Suite ($310.00) \n3. King Standard Room ($235.00) "; cout << "\n4. 2 Queen Beds Standard Room ($255.00) \n*****************************************" << endl << endl; //Req

Submitted: 351 days and 20 hours ago.
Category: Programming
Value: $34
Status: CLOSED
Picture
Expert:  active1065 replied 351 days and 20 hours ago.

Hello and welcome to JustAnswer. I look forward to assisting you today with your question and providing the best answer possible.

The requirement is large but cab be done..

When do you want this to be done i.e when is the deadline?

Customer replied 351 days and 20 hours ago.

Hi,
It is due on the 27th of April. Also, this is a beginning programming class so if possible could you not use too advanced code? :p

Picture
Expert:  active1065 replied 351 days and 19 hours ago.

I won't use complex coding.i will use basic loops and controlled structures and add commentsto the program so that it will be easy for you to understand.

But can you please reconsider the amount (as per your wish) after i provide the answer.

Thanks
active1065

Customer replied 351 days and 19 hours ago.

Absolutely. Thank you very much!

Picture
Expert:  active1065 replied 351 days and 19 hours ago.

I will start right now.

you will be notified once i post the solution.Do come back and check after sometime(maybe within a 1-2 hrs).

Thanks

Customer replied 351 days and 18 hours ago.

Ok.

Picture
Expert:  active1065 replied 351 days and 17 hours ago.

Maybe i was not able to estimate the time.

i have completed 50% of the program.
Will test the program once done and then provide you the code with the output.

Customer replied 351 days and 15 hours ago.

No problem. :)

Picture
Expert:  active1065 replied 351 days and 9 hours ago.

I have completed till part 8.

will complete my daily activities today and start doing the remaining part in the evening.

Do come back in the sametime you posted the question yesterday.

Regards
active1065


Picture
Expert:  active1065 replied 350 days and 17 hours ago.

Hi,

Please let me know when you are online..I will provide the code to you.

Here is the exe file.It exactly works as you expect

http://www.mediafire.com/?tx7n3ja6ht9iq1o

please check and let me know..

warm regards
active1065


Customer replied 350 days and 16 hours ago.

Hi,
That looks good!

Picture
Expert:  active1065 replied 350 days and 16 hours ago.

Ok

here you go.It took me almost 3 hrs to write the code and test it for you(208 lines even i can't believe).

http://www.mediafire.com/?8ust78vv292u2r5


Please click on the accept button so that i can get paid for my work

Bonus is highly appreciated.

Regards
active065

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Picture
Expert:  active1065 replied 350 days and 16 hours ago.

I have written the code in basic c++ language.Have not used any functions other than that is asked in the program.

The code is itself self explanatory..

Do let me know if you have any doubts..

Customer replied 350 days and 16 hours ago.

Was there a header file called Strings.h too?

Customer replied 350 days and 16 hours ago.

I see where it says #include but do not have that file.

Accepted Answer

Picture
Expert:  active1065 replied 350 days and 16 hours ago.

No it is a predefined header file recognised by the compiler like iostream.h and used for string related functions.It's not a userdefined headerfile..

Remember, if for any reason you are unsatisfied with my answer, we can continue the conversation until you’re satisfied and Accept my answer. I can address follow up questions at no extra charge and I’m always here to help. Thank you for using JustAnswer!

Expert TypeSoftware Engineer
Category: Programming
Pos. Feedback: 100.0 %
Accepts: 38
Answered: 4/25/2012

Experience: Experience in C# ,ASP.NET,PHP,C,C ++,SQL

Ask this Expert a Question >
Customer replied 350 days and 16 hours ago.

For some reason Visual Studio 2010 isn't recognizing the header file on my laptop. I will be home in 2 hours from class and I will look at it again and accept the answer.

Customer replied 350 days and 16 hours ago.

Ok i found the issue. It was strings instead of string. Thank you so much for your help! It looks great!

 
Tweet

4 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
C ProgrammingDecode LabYour assignment is to write a C 4/9/2013
Reference the following instructions to assist you when completing 4/8/2013
First you will present the pseudo code with all the modules 4/8/2013
NA-112 4/8/2013
The first programming project involves completing a program 4/8/2013
RA-201 4/7/2013
This is my final exam for my c programming class. It is due 4/7/2013
Program Description Your program will display (see the sample 4/6/2013
RA-211 4/3/2013
ra-614 4/2/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
263 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us
© 2003-2013 JustAnswer LLC