Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Palices & Regulations V Subject Outline as a tel Task 2 Value: 5 marks Problem Description: Write a Java program to solve the problem

image text in transcribed

Palices & Regulations V Subject Outline as a tel Task 2 Value: 5 marks Problem Description: Write a Java program to solve the problem presented below. You may assume that the user will always enter valid data; you do not have to perform data validation. The entry charges to a zoo are: Children 5 years old and younger free Accompanied children from 6 to 15 years old: $2 each Unaccompanied children from 6 to 15 years old: $5 each Adults from 16 to 59 years old: $10 each Seniors from 60 years and older: $8 each An accompanied child is defined as one in a family group accompanied by an adult or a senior. An adult or senior can only count as accompanying one child from 6 to 15 years old. No limit is placed on the number of children 5 years old and younger, which is perhaps a failing on the part of the zoo authorities, but simplifies your problem. Ages are integers. Your program will calculate and display the entry charge for each family group and also display the total takings for a sequence of groups. In this process it will correctly determine the number of accompanied children and those not counted as accompanied in each family group. It will request the user to enter the number of children (6 - 15 years old), the number of adults (16-59 years old) and the number of seniors (60+ years old) for each group, and it will display the entry charge for each group. The following shows a sample run. Enter a group? (Yes=1/No=0): 1 Enter the number of children (age 6-15): 5 Enter the number of adults (age 16-59): 2 Enter the number of seniors (age 60+): 1 Total entry charge is $44 Enter a group? (Yes=1/No=0): 1 Enter the number of children (age 6-15): 1 Enter the number of adults (age 16-59): 2 Enter the number of seniors (age 60+): 0 Total entry charge is $22 L Enter a group? (Yes=1/No=0): 0 Total takings: $66 You may assume that the user of the program enters the inputs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Management for Public Health and Not for Profit Organizations

Authors: Steven A. Finkler, Thad Calabrese

4th edition

133060411, 132805669, 9780133060416, 978-0132805667

More Books

Students also viewed these Programming questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Write short notes on departmentation.

Answered: 1 week ago