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]
2 years ago
9

Write a program that dose the following:

Computers and Technology
1 answer:
Fynjy0 [20]2 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
Why did artists use pinhole cameras during the renaissance?
Dima020 [189]
Pinhole cameras were one of the most sophisticated devices of the period, it made tasks much easier it basically worked exactly like the human eye and is something just like tracing.
8 0
3 years ago
Pleas help I will give brainiest
stellarik [79]
1) A
2)D
3)C
4)A
5)D
Hope this will help u
5 0
2 years ago
Read 2 more answers
A photograph is taken by letting light fall on a light-sensitive medium, which then records the image onto that medium.
Andru [333]
True. At least that's how it is for camera's that print photos. Not digital cameras
4 0
3 years ago
Read 2 more answers
Which excel feature prevents you from having to type the same thing over and over?
tamaranim1 [39]

Answer:

Explanation: Another way by which you can do it, press the Ctrl+1 key on your keyboard, Format cells dialog box will get appear. Go to Alignment tab, Click on Justify in Vertical drop down list, click on ok. This is the way by which you can prevent the text from spilling over in Microsoft Excel 2010 and 2013.

6 0
2 years ago
Hi I need help, This assignment is for Assignment 6 Question 4 in edhesive for computer science. here is the prompt:
Alex17521 [72]

Answer:

Following are the python code to print the given pattern:

print('FOURTH') # using print method

for i in range(10): #using loop to count numbers

   for j in range(10-i): # use loop to print asterisk value in reverse order

       print("*", end=" ") #print value

   print("") #using print method for space

Output:

Please find the attachment.

Explanation:

The description of the above python program can be described as follows:

  • In the first line, use the print method, that print message "FOURTH".
  • In the next line, two for loop is used in which the first loop counts the number to be print value, inside the loop another for loop is used.
  • In this loop, it prints asterisk values in its reverse order and for new lines, it will use the print method with a single white space.

7 0
2 years ago
Other questions:
  • Which is the output of the formula =AND(12&gt;6;6&gt;3;3&gt;9)
    6·1 answer
  • Most people prefer to pay health insurance premiums rather than pay out of pocket for medical expenses because
    15·2 answers
  • Brainlist will be added!✴
    6·1 answer
  • The _____ search algorithm searches a list for a given item, starting with the first element and continues to compare the item w
    12·1 answer
  • If you tap or click the increase font size button too many times and make the font size too big, you can tap or click the _____
    9·1 answer
  • How can you employ one of the most powerful interactive business tools on the Internet today?
    11·1 answer
  • What is the highest numeral in a binary code?
    5·1 answer
  • Element primer a partir del qual es generarà l'energia central solar fotovoltaica
    9·1 answer
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • bro i got banned for posting an amazing bulk pic, but this dude literally posted an inappropriate, dafuq is wrong with this bann
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!