Define a function find_fee() that takes one parameter as a person's age traveling by train, and returns the ticket price. The price is returned as follows: If the person's age is more than 79 or less than 4, then the price is $5. If the person's age is between 17 and 62, inclusive, then the price is $29. Otherwise, the price is $14.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Define a function find_fee() that takes one parameter as a person's age traveling by train, and returns the ticket price. The price is returned as follows:

  • If the person's age is more than 79 or less than 4, then the price is $5.
  • If the person's age is between 17 and 62, inclusive, then the price is $29.
  • Otherwise, the price is $14.
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Knowledge Booster
Types of Function
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning