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
Maslowich
3 years ago
5

Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, conve

rt the sum to the nearest integer, and print the result.Use the static_caststatement with an appropriate equation to convert the sum to an integer. Compile and run your program with the following test data:Case 1: Input: 5.1, 5.1, 5.1, 5.1, 5.1. Expected Output: 26.Case 2: Input: 5.0, 5.0, 5.0, 5.0, 5.0. Expected Output: 25
Computers and Technology
1 answer:
juin [17]3 years ago
6 0

Answer:

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

   double num1, num2, num3, num4, num5, sum = 0;

   cout << "Input: ";

   cin >> num1 >> num2 >> num3 >> num4 >> num5;

   

   sum = num1 + num2 + num3 + num4 + num5;

   cout << "Output: " << static_cast<int>(round(sum)) << endl;

   return 0;

}

Explanation:

Include cmath to use the round function

Declare the variables

Get the five numbers from the user

Sum them and assign the result to the sum

Round the sum using the round function, and convert the sum to an integer using static_cast statement

Print the sum

You might be interested in
My duties included reviewing
ycow [4]

Answer:

Please check the explanation.

Explanation:

I carried my logical and administrative skills to stand in implementing the succeeding tasks allocated to me:

  • swotting acquiring trends
  • investigating client data
  • concocting yearly inclination reports.

The bullets and numbering and proper indentation make the reading stuff more easily understandable. And that is what we have done above.

4 0
3 years ago
How do I turn on your asus chromebook flip?
galben [10]
I believe the charger has to be connected for it to turn on.
3 0
3 years ago
In 3–5 sentences, describe how technology helps business professionals to be more efficient.
quester [9]

Answer:

Technology helps business professionals, keep more organized, communicate better, and effectively keeps businesses secure. Technology helps keep employee information and business paper work more organized using computers and software; while making it easier to communicate with employee's using e-mail and memo's.

Explanation:

8 0
4 years ago
Read 2 more answers
When the tv was created (year)
nikitadnepr [17]

Answer:

1927

Explanation:

6 0
3 years ago
Read 2 more answers
HAve a good week lads, good luck on work :D
Leno4ka [110]

Answer:

v; its alright.

Explanation: none v;

8 0
3 years ago
Read 2 more answers
Other questions:
  • A ____ appears at the bottom of your e-mail messages and contains standard information about yourself that the recipient can use
    5·1 answer
  • Mr. Yang is a doctor who regards video games as an effective means of staying fit. What type of game would he recommend to his p
    13·1 answer
  • Which of the following combines something you know, such as a password, with something you are (a biometric device such as a fin
    13·1 answer
  • A character with the point size of 10 is about 10/72 of once inch in height
    8·1 answer
  • HELP PLZZ FAST!!!!!
    10·2 answers
  • In an information systems framework, ________ is the bridge between the computer side on the left and the human side on the righ
    14·1 answer
  • What have been three technological changes to photography in the past 200 years?
    10·1 answer
  • For this assignment, select one of the organizations with a prominent IT department from the Topic 1 assignment. Once identified
    11·1 answer
  • Match the component to its function. resistor inductor capacitor battery transistor This component stores a temporary charge. ar
    7·2 answers
  • Which online note-taking device allows students to clip a page from a website and reuse it later?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!