Answered step by step
Verified Expert Solution
Question
1 Approved Answer
// 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
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
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