Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ / Program TicketPrice prints the price for a ticket to / / the Wonderland park based on an age input from the keyboard #include
Program TicketPrice prints the price for a ticket to
the Wonderland park based on an age input from the keyboard
#include
using namespace std;
int main
int age;
cout "Welcome to Wonderland Park! Please enter your age:"
endl;
cin age;
if age
cout "Children under can enjoy free admission. endl;
TO BE FILLED IN FOR EXERCISE
else
cout "Your ticket price is $ endl;
return ;
Exercise
Add two elseif statements so that children to years old including and only need to pay $
for ticket and senior citizens or above only need to pay $ for ticket. Run your program using the
following values as input: Show the statements you added and the results for the input
values in the report.
Note: Remove any redundant condition in the logical expressions you wrote for this exercise, otherwise
you may only earn partial credit even if the results are correct.
Exercise
Replace the following statement in Exercise
cout "Your ticket price is $ endl;
with compound statements to check if the guest is eligible for other discounts. Display the following
message:
Are you a student or veteran?
Please enter Y for Yes and N for No
If the answer is Y then display the following message:
"You may be eligible for discounted price.
Please show your ID to our staff."
Otherwise the answer is N display the original message of price $ Show your compound
statements and the results of a few testing cases.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started