Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

done in c++

Program Specifications:

Write a program that asks for a user's name and age, finds the ticket price based on the age, and prints out the user's name, age, and ticket price.

The program must define the following 3 functions and call them in the main function.

  1. Create a function called getName that takes in no arguments and returns the name of the user. 

  2. Create a function called getAge that takes in the argument age and uses pass-by-reference to set the age of the user. Ensure that the user cannot put in an age that is negative or greater than 100. 
  1. Create a function called printTicket that takes in the user's name and age and does the following

○      If they are less than or equal to 13 years old set ticket_Price to 9.99.

○      If their age is greater than 13 and less than 65, set ticket_Price to 19.99.

○      If their age is greater than or equal to 65, set ticket_Price to 12.99.

○      Output to the console the user's name, age and ticket price.

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education