1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
morpeh [17]
3 years ago
10

An athlete runs every day for five days. Write a program that computes the total distance and average distance ran by the athlet

e. 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.
Computers and Technology
1 answer:
Tamiku [17]3 years ago
5 0

Answer:

// here is Hw1_q1_code.c

#include <stdio.h>

// main function

int main(void) {

// variables

float dis_mon,dis_tue,dis_wed,dis_thu,dis_fri;

printf("enter distance ran by athlete on monday:");

// read distance on monday

scanf("%f",&dis_mon);

printf("enter distance ran by athlete on tuesday:");

// read distance on tuesday

scanf("%f",&dis_tue);

printf("enter distance ran by athlete on wednesday:");

// read distance on wednesday

scanf("%f",&dis_wed);

printf("enter distance ran by athlete on thursday:");

// read distance on thursday

scanf("%f",&dis_thu);

printf("enter distance ran by athlete on friday:");

// read distance on friday

scanf("%f",&dis_fri);

// total distance

float sum=dis_mon+dis_tue+dis_wed+dis_thu+dis_fri;

// average distance

float average=sum/5;

// print the total and average

printf("total distance ran by athlete is: %f miles",sum);

printf("\naverage distance ran each day is: %f miles",average);

return 0;

}

Explanation:

Declare five variables to store distance ran by athlete on each day from monday to friday.Read the five distance.Then calculate their sum and assign to variable "sum".Find the average distance ran by athlete by dividing sum with 5 and assign to variable "average".Then print the total distance ran and average distance on each day.

Output:

enter distance ran by athlete on monday:10                                                                                            

enter distance ran by athlete on tuesday:11                                                                                          

enter distance ran by athlete on wednesday:8                                                                                          

enter distance ran by athlete on thursday:9                                                                                          

enter distance ran by athlete on friday:12                                                                                            

total distance ran by athlete is: 50.000000 miles                                                                          

average distance ran each day is: 10.000000 miles

You might be interested in
Discuss the advantages of using analogue multi-tester or digital multi-tester over the other.​
QveST [7]

Answer:

Advantages of Digital Multimeters:

1)They are more accurate than analog multimeters.

2)They reduce reading and interpolation errors.

3)The 'auto-polarity' function can prevent problems from connecting the meter to a test circuit with the wrong polarity.

4)Parallax errors are eliminated.

I hope this helps.

8 0
3 years ago
Which of the following examines the organizational resource of information and regulates its definitions, uses, value, and distr
hichkok12 [17]

Answer:C)Information management

Explanation: Information management is the technique through which the organization and handling of the the data/ information takes place.This technique is made for helping the organization and their business for the supporting the function and processes.

The facilities provided by the information management system is  development, management, designing, innovation etc.

Other options are incorrect because they are used for the coding process,technology and governing of the data, hence no management activity is done by them.Thus, the correct option is option(C).

4 0
3 years ago
To secure the company website, the webmaster suggests that the company purchase a secure certificate to encrypt all communicatio
iVinArrow [24]

Answer: Software

Explanation:

Security certificate is defined as the assurance that maintain authenticity and intactness of a website or different sites.It is present in small sized data filed that establishes encryption and validation through verification of owner's identity.

  • As per the suggestion of Webmaster, who takes care of web-pages and web-servers , security certificate should be purchased to verify the transmission of message with encryption.
  • Certificate in this case will be acting as software for providing security and operations to the websites.

4 0
3 years ago
Timothy is a multimedia designer. He needs to create a prototype of a new product that his firm is launching. Which multimedia s
mestny [16]

Explanation:

The answer is D. 3-f modeling

5 0
3 years ago
The it department is reporting that a company web server is receiving an abnormally high number of web page requests from differ
Talja [164]
<span>In the scenario in which the IT department is reporting that a company web server is receiving an abnormally high number of web page requests from different locations simultaneously the DDoS security attack is occurring.
</span>DDos stands for Distributed Denial of Service<span> . This </span><span>attack is an attempt to make an online service unavailable by overwhelming it with traffic from multiple sources.</span>
8 0
3 years ago
Other questions:
  • Holly would like to run an annual major disaster recovery test that is as thorough and realistic as possible. She also wants to
    5·1 answer
  • Why is the keyboard arranged in the QWERTY style?
    6·2 answers
  • Hurry answerrrrrrr pleaseee
    11·2 answers
  • A store trying to analyze the behavior of its customers will often maintaina two-dimensional array A, where the rows correspond
    6·1 answer
  • -Convert the 1's complement 10111010 to decimal
    15·2 answers
  • I need help with workplace safety systems please help
    10·1 answer
  • Differentiate between perfect and imperfect market​
    14·1 answer
  • Briefly explain how Riboflavin deficiency lead to disease state.​
    15·1 answer
  • Alayna is researching information online to write her essay about the Berlin Wall.
    8·1 answer
  • The arrangement of keys on a keyboard, QWERTY reflects the keyboard layout by ________. Group of answer choices using the letter
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!