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
4 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]4 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
Which programming language is good for 14 year old like me​
ddd [48]

Answer:

It would be Python code

Explanation:

4 0
3 years ago
Read 2 more answers
20. A computer freezes at odd times. At first, you suspected the power supply or overheating, but you have eliminated overheatin
ahrayia [7]

Answer:

Flash BIOS

Explanation:

In flash BIOS, BIOS is stand for basic input output system.

Flash BIOS the process by which we update the PC motherboard , its software .

It is mainly done to increase the performance and capabilities of a computer.

It is in the form of a chip and not in form of hard drive.

After flash BIOS the performance of computer is increases to great extent.

7 0
3 years ago
Greg works outside. He is often found cutting grass and making the local park grounds look nice for guests.
kvasek [131]

Answer:

C Landscaper

Explanation:

From what I know about landscapers and from the description that makes the most sense.

3 0
4 years ago
What mass of nh3 can be made from 35g of n2?
Anton [14]
 <span>14 g N in 17 g NH3 
so 35 g N will make 17*35/14 = 42.5 g</span>
3 0
3 years ago
What does an animation sequence action do?
OlgaM077 [116]

B) Plays an object's animation

An animation is a single drawing, cartoon, sketch, etc., but a sequence of animations can create movement, which appears to the viewer as the object or subject in motion.

3 0
3 years ago
Read 2 more answers
Other questions:
  • What does the term Gestalt mean?<br> A image<br> B graph<br> C big<br> D part <br> E whole
    11·1 answer
  • To edit the text in a SmartArt graphic, what must be done first?
    5·1 answer
  • What are the five layers in the internet protocol stack? What are the principal responsibilities of each of these lay?
    9·1 answer
  • An app builder wants to show groups as the last navigation menu item in the Salesforce1 mobile app. However, the app builder is
    8·1 answer
  • Computers store temporary Internet files in the Recycle Bin. These files take up space and slow down a computer. Which tool can
    14·1 answer
  • As your textbook explains, Wikipedia is usually the only source you need when
    8·1 answer
  • What is the output of the following code snippet? int s1 = 20; if (s1 &lt;= 20) { System.out.print("1"); } if (s1 &lt;= 40) { Sy
    6·1 answer
  • Python program
    9·1 answer
  • Draw a chart showing the crossing between red and white flowered pea plants till F2 generation. Find out the genotypic and pheno
    6·1 answer
  • What are the fundamental activities that are common to all software processes?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!