4. Nested Logic Use program TicketPrice for exercises 6-7. // 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 6. (8pts) Add two else-if statements so that children 4 to 12 years old (including 4 and 12) only need to pay $20 for ticket and senior citizens 65 or above only need to pay $30 for ticket. Run your program using the following values as input: 2, 4, 12, 37, 65s, 71. 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.
4. Nested Logic Use program TicketPrice for exercises 6-7. // 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 6. (8pts) Add two else-if statements so that children 4 to 12 years old (including 4 and 12) only need to pay $20 for ticket and senior citizens 65 or above only need to pay $30 for ticket. Run your program using the following values as input: 2, 4, 12, 37, 65s, 71. 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.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Can anyone help me with these coding questions
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education