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
When law enforcement becomes involved, the need may arise to freeze systems as part of the evidence. There is also the likelihoo
Sindrei [870]

Answer:

Costs will cover a need for more customer data. The further explanation is given below.

Explanation:

  • It's the greatest problem for almost every company to provide the data with security.
  • This is possible for highly trained practitioners and the technical staff to take charge of it.
  • Complicated technologies would have been going to run together again to withstand these types of jobs.
  • Such problems play a major part in the decision-making process affecting the law enforcement authorities to locate the suspects to strengthen the organization.
  • To do something like this, there seem to be a lot of other good initiatives out there doing it.

There have been some cases in which major corporations have chosen not to include law enforcement:

  • There are many more electronic corruption going on, including money robbery, asset fraud, as well as machine assaults.
  • In such a bigger case, numerous institutions, such as large-scale ones, have gone through these circumstances to evaluate law enforcement to come to terms with cybersecurity.
5 0
3 years ago
What is the typical relationship between time and interest rate?
prisoha [69]
The relationship between time and interest is: time allowed to repay the loan (monthly payments)
7 0
3 years ago
If you use your smartphone as a hotspot to connect to the Internet on your tablet you are using a ________.quillet
Nataly [62]
Personal Area Network
7 0
2 years ago
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
A method a. may have zero or more parameters b. never has parameter variables c. must have at least two parameter variables d. m
Lynna [10]

Answer:

The answer is "Option a"

Explanation:

A method is a technique, that associated with both a message and an object. It includes information, behavior, and actions of an interface defining, how the object can be used, and wrong choices can be described as follows:

  • In option b, It includes parameters in the method.
  • In option c, It contains a parameter, that may be one or more.
  • In option d, It contains one parameter also.

5 0
3 years ago
Other questions:
  • Is anyone else experiencing the wording::nonifacation::glitch about the "5 hours ago" thingy to whenever you answer a question o
    7·2 answers
  • What is a binary message
    12·2 answers
  • Ben pays his mobile bills, watches movies, and shops online using the Internet. Which internet activity does he perform?
    13·2 answers
  • What is the difference between the web and the internet?
    14·1 answer
  • The term integration mean?
    7·2 answers
  • What legal protection would cover a person invention?
    10·2 answers
  • Brainly Question
    14·2 answers
  • Modern life is not possible if computer stops working? Give your opinion<br>​
    7·1 answer
  • PLEASE HELP! I accidently looked up a link, and now this same link keeps popping up everywhere, how do I stop this!?!? please he
    13·2 answers
  • 1.Microsoft Word is a/an ........​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!