Question: // ticket.cpp - This program asks for an age and displays the cost of the ticket #include using namespace std; int main( ) { double

// ticket.cpp - This program asks for an age and displays the cost of the ticket #include using namespace std;

int main( ) { double age, ticket = 12;

cout << "Please enter the age "; cin >> age; if(age <= 8) ticket = 6;

cout << "Your ticket costs " << ticket << endl;

return 0; }

Exercise 2.2.1 Change the ticket.cpp program such that it displays $6 for people who are 8 years old or younger OR 65 years or older.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!