Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program will calculate the number of miles in three different swimming workout plans. The plans assume the swimmer will make laps back and forth

This program will calculate the number of miles in three different swimming workout plans. The plans assume the swimmer will make laps back and forth in pool that is 25 yards in length. One lap is considered swimming 25 yards one way in the pool. The three plans are short (100 laps), medium (150 laps), and long (225 laps).  The program should have a String variable with the user's name assigned (use your own name in the code).  Create other variables as necessary, making sure to create the least number of variables necessary (you can reuse a variable). Follow the output below exactly. All miles output should be two decimal places.  You cannot do calculations in the system.out.print/println/printf lines.  All numbers and the String variable are used in the program by assigning the values to variables directly in the code. There is no user input. Hint: you must convert yards to miles.

SAMPLE OUTPUT:
 

********************************************
 

        Swimming Workout Calculator  
********************************************
 
Hi Cathy!
This calculator will give you three workouts, assuming 25 yards per lap.
 
For a quick swim, make 100 laps. This is xx.xx miles.
 
For a medium swim, make 150 laps. This is xx.xx miles.
 
For a long swim, make 225 laps. This is xx.xx miles.

  

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_2

Step: 3

blur-text-image_3

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

An Introduction to Management Science Quantitative Approach to Decision Making

Authors: David R. Anderson, Dennis J. Sweeney, Thomas A. Williams, Jeffrey D. Camm, James J. Cochran

15th edition

978-1337406529

More Books

Students also viewed these Programming questions