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
Which of the following statements regarding EFT is false? EFT still requires the endorsement of a check EFT allows payment to be
hammer [34]

A smart way of moving money from one personal banking account directly to another account is called EFT or electric fund transfer. There is a maximum clearance time of 24 hours for transfer.  The most widely-used program is Direct Deposit, in which payroll is deposited straight into an employee's bank account initiated through an electronic terminal, including credit card, Therefore, the following<span> statement regarding EFT is false?</span>

<span>1.                  </span><span>EFT still requires the endorsement of a check </span>

3 0
3 years ago
PLEASE HELP!! FIRST ANSWER WILL MARK AS BRAINLIEST!!!
3241004551 [841]

Use the "As an Outlook Contact" option.

0 0
3 years ago
Sketch the frequency response?
natita [175]
Well... it looks too complicated for anyone in the whole universe. :\
5 0
4 years ago
Match the steps with the actions that are involved when an internal host with IP address 192.168.10.10 attempts to send a packet
Anna35 [415]

Answer:

Following are the steps with actions that are involved in required to perform a packet transfer.

Explanation:

  • Step 1: The host sends a connection request to server which is at IP address 209.165.200.254
  • Step 2: R1 check the configuration of NAT to inquire weather the packet should be translated or not.
  • Step 3: If there is no entry found for translation of given IP address, It is assumed that the IP address 192.168.10.10  will be translated already.
  • Step 4: R1 selects a global address  from the dynamic address pool that is available to it.
  • Step 5: R1 replaces the given IP address 192.168.10.10  with the translated inside global address.

i hope it will help you!

5 0
3 years ago
Cloud kicks recently completed the implementation of sales cloud. Cloud kicks has trained the users to use the mobile app to acc
aleksandrvk [35]

Answer:

see how long the people are on the app and see low long te time is constant where nobody is on at all

Explanation:

7 0
4 years ago
Other questions:
  • The ________ defines every object and element on a web page.
    13·1 answer
  • Explain the nature of documents that can be suitable for mergin
    12·1 answer
  • "Create a Python program named detect_column_level_data_entry_errors. When complete, you will run this program to produce a diag
    11·1 answer
  • You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
    7·1 answer
  • Real GDP is found by removing the effects of inflation. How is this done mathematically?
    5·1 answer
  • Say you write a program that makes use of the Random class, but you fail to include an import statement for java.util.Random (or
    10·1 answer
  • Write a method that takes in a String and returns a new
    15·1 answer
  • 1. (15%) Consider a computer system with three users: Alice, Bob, and Cyndy. Alice owns the file a, and Bob and Cyndy can read i
    9·1 answer
  • Explain the history of computing device of mechanical era
    7·1 answer
  • A mobile phone app asks the user to point the phone's camera at a room and then applies the phone's lidar scanning function. wha
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!