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
An excel file called “student_gpa” is opened. What does the funnel next to “GPA” indicate
Ivan

Answer is A. The data has been filtered

The funnel in Excel lets you know that there is a filter in place on the columns. It is a filter icon. By default, any filtered column in Excel gets a little funnel icon on the top row as shown in the image attached. Once this funnel symbols is clicked, it gives you options to filter using several criteria.

6 0
3 years ago
Green Fields Landscaping Company sells evergreen trees which are priced by height. Customers have a choice of purchasing a tree
Tomtit [17]

Answer:

Answered below

Explanation:

//Program is written in Python programming //language.

number_of_trees = int(input ("Enter number of trees purchased: "))

height_of_trees = float(input("Enter height of trees: "))

delivery_status = input("Do you want trees delivered? enter yes or no ")

price_of_two_meters = 20

total_price = number_of_trees * price_of_two_meters

//Invoice

print (number_of_trees)

print(height_of_trees)

print (total_price)

print (delivery_status)

8 0
3 years ago
Does anyone go to connections acadomy​
Komok [63]

Answer:

no I dont where is that at

7 0
2 years ago
Read 2 more answers
Hãy mô tả mô hình xử lý của hệ thống thông <br> tin kế toán tài chính trong một doanh nghiệp
GrogVix [38]
Yes because it’s the square size of life
6 0
2 years ago
Security measures are sometimes described as a combination of physical, technical, and administrative (PTA) safeguards. Which of
attashe74 [19]

Answer:

Measures including device data encryption, anti-malware software, and communications encryption.

6 0
3 years ago
Other questions:
  • Which innovation allowed for the mass production of goods? A. Cotton gin B. Sewing machine C. Industrial lubricator D. Interchan
    6·1 answer
  • Which statement prints "hi" on the screen?
    5·2 answers
  • Which fingers should you use to type the reach keys?
    12·1 answer
  • FS and GS are two___________________ in protected mode.
    14·1 answer
  • I am buying a BluRay drive access time is 180ms and the other is 210ms(BD-ROM) whats does access time mean
    5·1 answer
  • Analyze the problem statement. Select the correct answer. Vision: We want to decrease errors in our billings to clients. Issue:
    5·1 answer
  • Good Morning! Please Help!
    15·1 answer
  • How does a search engine use algorithms to provide search results?
    15·2 answers
  • Research and build a chroot jail that isolates ssh users who belong to the restrictssh group. (You will also need to create the
    9·1 answer
  • Drag each tile to the correct box.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!