Answered step by step
Verified Expert Solution
Link Copied!

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 <=3)
cout << "Children under 3 can enjoy free admission. "<< endl;
/* TO BE FILLED IN FOR EXERCISE 6*/
else
cout << "Your ticket price is $50."<< endl;
return 0;
}
Exercise 7
Replace the following statement;
cout << "Your ticket price is $50."<< 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:
College of Engineering, California Baptist University 4
EGR 121 Introduction to Computer Programming in C++
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 $50. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Let f, g: Z+ R. Prove that f (g) if and only if g 0(f).

Answered: 1 week ago

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago