Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1. Run Tracking (30 points) An athlete runs every day for five days. Write a program that computes the total distance and average distance

Problem 1. Run Tracking (30 points) An athlete runs every day for five days. Write a program that computes the total distance and average distance ran by the athlete. The program should ask the user for the number of miles run on each day (Monday to Friday), and save the values entered by the user in five different variables. The program should first calculate the total miles ran by the athlete and store the result in a variable named sum. Then the program should compute the average distance covered and store it in a variable named average. Display the total distance and the average distance on the screen. Name your program file Hw1_q1_code.c. (TIP: Use scanf function, and float/double data type for all variables) Example hints and inputs: (purple texts are what the program should print on the screen to instruct the user, the black texts are what the user types in)

Input the miles for Monday: 2.5

Input the miles for Tuesday: 1.5

Input the miles for Wednesday: 2.2

Input the miles for Thursday: 1.8

Input the miles for Friday: 3.0

Example outputs: Sum = 11 miles Average = 2.2 miles

I know this is probably simple to most, but I'm super new to coding and not entirely sure as to where to even start? Also it's supposed to be in C (using Notepad++)

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

=+What is the most that you should pay to complete development?

Answered: 1 week ago