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
Joseph wants to take out the color of the background wall from an image what can Joseph do to achieve this​
snow_lady [41]

Answer:

Go to remove a background website

Explanation:

6 0
3 years ago
Read 2 more answers
Your friend just gave you his old laptop. Whenever you turn on the laptop, though, a black screen appears and asks you to enter
Anastasy [175]

Answer:
C is the answer!

Explanation:

A hard drive contains your operating system which can include your settings and preferences that you included in your device. But it mostly is a storage device so we know it WOULD NOT BE (B.

WOULD NOT BE D beacause powering it back on wouldnt do anything but bring you back to the start.

WOULD NOT BE A beacuse when taking out the battery then putting it back in would just be like turning it off then back on beacuse that just hold the power to a device.

IT WOULD BE C, C IS THE ANSWER beacuse a CMOS batttery contains the main system settings and  also contains information so i think C would be the best answer for this choice.


Hope this helps!
xx <3

7 0
3 years ago
To inspire unit 1 App
Tasya [4]
Is there more to this or ?
5 0
3 years ago
What is a fixed expense<br> everfi
Gelneren [198K]

Answer:

A fixed expense is an expense that has a constant total expense value (the total amount of the fixed expense) that remains the same (does not change) when there is a change in the number being managed, manufactured, or sold

Examples of fixed  expense includes; depreciation of assets, salaries of workers, payment for rental lease, and some utility payment, such as road users toll fees payment at a toll gate

Explanation:

8 0
3 years ago
25 Points!
neonofarm [45]

Answer:

I believe the answer is D. var = var + 1

Explanation:

5 0
3 years ago
Other questions:
  • For film editors, which task comes last in their workflow pattern?
    12·2 answers
  • Suppose a retailer who has no technology expertise wishes to set up an online presence for his business. He ________. a. ​can us
    6·1 answer
  • What is DAP? How LDAP is different from DAP?
    10·1 answer
  • How to get this on your screen in 2k20 on Xbox
    14·2 answers
  • If you want to open an application that does not have a tile pinned to the Start menu, _____ to find it in the list of installed
    7·1 answer
  • What laptops can you get for 2500$ and should mostly using Microsoft applications.
    14·2 answers
  • IOS jail broken or Android unrooted which is better to hack with
    6·1 answer
  • Which K-Drama was made in 2009?
    5·2 answers
  • What decides the amount of delay between shots on a digital camera?
    7·1 answer
  • You Could Never Size Me UP! Been Doing This Sh*t A Long ⏱time
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!