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
Marrrta [24]
3 years ago
9

Write a program that dose the following:

Computers and Technology
1 answer:
Fynjy0 [20]3 years ago
5 0

Answer:

#include<iostream>

#include<cmath>

using namespace std;

int main(){

   float num;

   float sum = 0.0;

   for(int i=1;i<=5;i++){

       cout<<"\nPlease enter the number: ";

       cin>>num;

       sum = sum + round(num);

   }

   float avg = sum/5;

   cout<<"The sum is: "<<sum<<endl;

   cout<<"The average is: "<<avg<<endl;

}

Explanation:

Create the main function and declare the variable 'num' and define the variable sum with zero.

Then, take a for loop and it runs for 5 times because of the condition i<=5.

print the message for the user on the screen, then the user enters the decimal value. After that, round the decimal number to the nearest integer.

we can use inbuilt function round(), which is defined in the cmath library and it takes the argument decimal.

For example:

round(5.89) it gives the integer 6.

Then, take the sum of all-rounded value and this process runs for 5 times. after that, take the average by dividing the sum by 5.

and then, print the sum and average value.

You might be interested in
Place Letter or word in correct section where it says labels bellow
love history [14]
A beauty its not b c or d
3 0
3 years ago
Read 2 more answers
My rank hasn't changed even though i've passed the point mark and i even tried to relogin but it still didn't change.
tatyana61 [14]
You need to wait, it isn't the website that ranks you, but actual people on the site. Just wait, have patience. 
5 0
3 years ago
Read 2 more answers
Explain what LIFO and FIFO mean, and how they are used in Abstract data types?
Dimas [21]

Answer:

LIFO stands for Last In First Out. This procedure is used in the Stacks in data structures.Stacks are the data types in which the data is stored called Stack.

Explanation:

8 0
3 years ago
Fill in the blank with the correct response.
Karo-lina-s [1.5K]

Answer:

logical

Explanation:

4 0
3 years ago
Read 2 more answers
3. Of the following pieces of information in a document, for which would you most likely insert a mail merge field? A. First nam
lara [203]
I would suggest the answer would be both A and D, mail merge is used to specify different field for different recipients. 
8 0
4 years ago
Read 2 more answers
Other questions:
  • What inventor patented the first America movie projector
    13·2 answers
  • Convot the following biliary number into decimal form using any method ? (1010.100)2
    8·1 answer
  • 6.12 Nested Increments Write a program for spiritual lumberjacks who want to show their appreciation for each tree they 'kill' b
    12·1 answer
  • Can you share a google Docx. with a person who has an Icloud Email?
    11·1 answer
  • 11. The golden rule of safe driving is: A. Always drive at the posted speed limit B. Never drive while physically or mentally im
    15·1 answer
  • List 7 basic internal component found in a computer tower?
    11·2 answers
  • What is word length in computer​
    10·2 answers
  • Does anyone know what to do when brainly won't let you answer questions? I click on answer question and then it just sits there
    15·2 answers
  • Which format of image files can be inserted in html?​
    8·2 answers
  • Give the value of the zero flag, the carry flag, the signflag, and the overflow flag after each of the following instructions if
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!