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
Who was the creator of the game Fnaf?
Lisa [10]
"Scott Cawthon" did that.........
8 0
3 years ago
Read 2 more answers
Write a recursive function called digit_count() that takes a positive integer as a parameter and returns the number of digits in
Gelneren [198K]

Using the computational knowledge in python it is possible to write a code that Write a recursive function called digit_count()

<h3>What is a function in Python?</h3>

In Python, a function is a sequence of commands that performs some task and that has a name. Its main purpose is to help us organize programs into chunks that correspond to how we envision a solution to the problem.

<h3>Writting the code in python:</h3>

<em>def countDigits(n):</em>

<em>   if n< 10:</em>

<em>      return 1</em>

<em>   else:</em>

<em>       return 1 + countDigits(n / 10)</em>

See more about python at brainly.com/question/13437928

#SPJ1

8 0
2 years ago
Which principle or element of layout design is highlighted in this event poster?
Oduvanchick [21]

The  principle or element of layout design is highlighted in an event poster in option i: The headline.

<h3>What are the elements of page layout?</h3>

The poster is known to be one that often uses a kind of hierarchy and centered text alignment as its element.

Note that it is one whose Lines of use is said to be made up of different kinds of type styles, sizes and others.

The simple elements of an advertising poster is made up of:

1. The headline.

2. The sub-head.

3. The body copy.

4. The caption.

The elements of page layout are visual hierarchy, visual flow, and others. Hence, the  principle or element of layout design is highlighted in an event poster in option i: The headline.

Learn more about layout design from

brainly.com/question/2501083

#SPJ1

6 0
2 years ago
Describe how layers in the ISO reference model correspond tolayers in the TCP/IP reference model.
Alexxx [7]

Answer and explanation : The TCP/IP means TRANSMISSION CONTROL PROTOCOL AND INTERNET PROTOCOL It governs all the communication which are performed over network it has a set of protocol. It defines how different types of conversation are performed without any fault through a network

THERE ARE 5 TYPES OF LAYER IN TCP/IP MODEL

  • APPLICATION LAYER: It is present at upper level it is used for high level products for the network communication
  • TRANSPORT LAYER: This layer is used for transfering the message from one end to other end
  • NETWORK LAYER : Routers are present in network layer which are are responsible for data transmission
  • DATALINK LAYER : it is used when there is any problem in physical layer for correcting this datalink are used
  • PHYSICAL LAYER: Physical; layer are responsible for codding purpose which we used in communication process

5 0
3 years ago
Explain your understanding of distributed object system.
Paraphin [41]

Answer:

In the distributing computing, distributed object system is the process in which the distributed object are get distributed in different address space. The distributed object system is the enhancement of the client server model.

Distributed object are basically refers to the software module which are designed in such a way, so that they work together in the network.

And it is distributed physically within the network area and the methods is executed on the basis of remote host in the distributed system.  

7 0
3 years ago
Other questions:
  • Operating systems are designed to work with specific hardware. Which operating system works with Apple computers?
    8·2 answers
  • The operations planning practice of inputting sales forecasts into computer software that accurately predicts the amount and tim
    6·1 answer
  • Write the pseudocode for linear search, which scans through the sequence, looking for ν. Using a loop invariant, prove that your
    14·1 answer
  • What software that allow for one-click performance profiles for msi video card??
    5·1 answer
  • Suppose one hundred stores participated in the
    14·1 answer
  • Bytes are typically represented with a lowercase b and bits with an uppercase B.<br> true or false
    7·1 answer
  • Write a function that, given an array A of N integers, of which represents loads caused by successive processes, the function sh
    15·1 answer
  • Define get_date() function.
    6·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • Discuss the concept of the “state of a process”. Give examples to illustrateyour answers?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!