Question: Using the vim editor, create Go programs that solve the following problems: The Triathlon Problem: The number of calories burned per hour by cycling, running,

Using the vim editor, create Go programs that solve the following problems:

The Triathlon Problem: The number of calories burned per hour by cycling, running, and swimming are 225, 450, and 275, respectively. A person loses 1 pound of weight for each 3,800 calories burned. Write a program to request the number of hours spent at each activity and then display the number of calories burned and the number of pounds worked off.

The Triathlon Problem

Ask the user for the number of triathletes

Have your program loop the inputs, calculations, and outputs for each triathlete

Use the Printf function to format your output

The spacing and formatting precision should exactly mirror that as shown below:

Using the vim editor, create Go programs that solve the following problems:

//---------------------------------------------------------------------------------------------Text for copy

How many triathletes are there? 3

Athlete #1: Enter cycling hours: 2 Enter running hours: 2 Enter swimming hours: 2 Total calories: XXXX Pounds lost: Y.YY

Athlete #2: Enter cycling hours: 3 Enter running hours: 2 Enter swimming hours: 4 Total calories: XXXX Pounds lost: Y.YY

Athlete #3: Enter cycling hours: 1.7 Enter running hours: 2.11 Enter swimming hours: 1.89 Total calories: XXXX Pounds lost: Y.YY

//---------------------------------------------------------------------------------------------Text for copy

Additional comments throughout the program should be included where appropriate.

File should be run as text files with ".go" extensions and Show output.

How many triathletes are there? 3 Athlete #1: Enter cycling hours: 2 Enter running hours: 2 Enter swimming hours: 2 Total calories: XXXX Pounds lost: Y.YY Athlete #2: Enter cycling hours: 3 Enter running hours: 2 Enter swimming hours: 4 Total calories: XXXX Pounds lost: Y.YY Athlete #3: Enter cycling hours: 1.7 Enter running hours: 2.11 Enter swimming hours: 1.89 Total calories: XXXX Pounds lost: Y. YY

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!