JQ is taking a car trip with his family. On the trip, he will stop for fuel, food or lodging. When stopping for gas, JQ will record the amount of fuel he is willing to pay for. When the family stops for lodging, they will also have a meal. JQ is only willing to spend a maximum of $75 on accommodation. If the motel manager says the price is greater than $75, JQ will complain “We will look elsewhere”. If the charge is less or equal to $75, he will pay the amount and exclaim “Wonderful, we will stay!” JQ will record all expenses paid for lodging and food.
Write a program that simulates the trip by keeping track of the total amounts paid for fuel, food and lodging. The program should present a menu as follows:
1.Get Gas
2.Get Meal
3.Lodging
4.Exit
And also provide functions for each of the options. Get Gas gets the total amount paid for gas and prints it out. Get Meal gets the total amount paid for food and prints it out. Lodging gets the cost of the lodging and prints the appropriate message dependent on JQ’s preference. When Exit is selected, the total spent for each of fuel, food and lodging must be displayed.

Odd use of tags there as I might think you want this code in five languages. But this does sound like homework or an assignment. I'm sure you can create the code for the menu so what steps stopped you from moving forward?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.