Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A local gym offers family plan membership based on the following. Cost: $100 Access: 2 adults and 2 teenagers Promo code: $10 discount Write

imageimage

A local gym offers family plan membership based on the following. Cost: $100 Access: 2 adults and 2 teenagers Promo code: $10 discount Write a program called GymXYZ (replaced XYZ by your first and last name) that prompts the user to enter the number of adults, teenagers and promo code. If more than 4 people in total are entered, display the message "Family is too large" and exit If the promo code equals 7348, display "Valid promo code" and apply a $10 discount of the total cost. Display the total and average cost per person with 2 decimal places using printf. Submit your java file. No other file formats will be accepted. Sample runs are shown below Enter number of adults, teenagers and promo code: 3 2 7348 Family is too large! Enter number of adults, teenagers and promo code: 2 2 4789 Total membership cost: $100.00 Average cost per person: $25.00 Enter number of adults, teenagers and promo code: 1 2 7348 Valid promo code! Total membership cost: $90.00 Average cost per person: $30.00 Enter number of adults, teenagers and promo code: 20 1679 Total membership cost: $100.00 Average cost per person: $50.00

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

Fundamental Managerial Accounting Concepts

Authors: Thomas Edmonds, Christopher Edmonds, Bor Yi Tsay, Philip Olds

8th edition

978-1259569197

More Books

Students also viewed these Programming questions