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
A touch screen can be used as both an input device and output device. explain how this is possible
Evgesh-ka [11]

Well, Touch screen is only an input device as it only takes the input resistance(or capacitance in new touch screens) value as per the touch on the screen. And this value of resistance would determine the location of the touch on the screen.

The output work is done by the LCD or LED displays, which displays some images and texts on screen.

Touch Screen is only a transparent glass which is place on that display and synchronized with the LED displays such that user is able to 'touch' or have a 'sense of touch' on the actual displays

5 0
3 years ago
What is a detailed and thorough review of the deployed security infrastructure compared with the organization’s security policy
Sonbull [250]

Answer:

"Compliance audit " seems to be the correct answer.

Explanation:

  • A compliance or enforcement audit seems to be a systematic analysis of the conformity of such an agency to the reporting requirements and guidelines.
  • In a compliance audit, independent auditors determine the extent and completeness of enforcement plans, security protocols, user authentication, including risk management framework.
8 0
3 years ago
What is you full name ?​
Svetllana [295]

Answer:

Name: Whydoyouneedtoknow

8 0
3 years ago
Read 2 more answers
How does an employer judge a candidate ​
vaieri [72.5K]
Test the candidate
Assess for practical experience
Determine strengths needed for the position.
6 0
4 years ago
Please write an Introduction on intrusion detection system and prevention system<br> PLEASE
77julia77 [94]

Answer:

An Intrusion Detection System (IDS) is a system that monitors network traffic for suspicious activity and issues alerts when such activity is discovered. It is a software application that scans a network or a system for harmful activity or policy breaching. Any malicious venture or violation is normally reported either to an administrator or collected centrally using a security information and event management (SIEM) system. A SIEM system integrates outputs from multiple sources and uses alarm filtering techniques to differentiate malicious activity from false alarms.

6 0
2 years ago
Other questions:
  • Your recovery/recycling machine has r-502 refrigerant in it. you now have to recover refrigerant from a unit with r-22. what mus
    12·1 answer
  • Which logic gate produces an output of 1 only if both it’s inputs are 0?
    10·2 answers
  • Two types of business communications enhanced by desktop publishing are
    7·2 answers
  • Look at the data set below. {6, 7, 12, 5, 7, 11, 10, 7, 6} In this data set, what is the mode?
    9·2 answers
  • Top Down Design makes it easier to solve a problem by:___________
    10·1 answer
  • Write a program in which you input three numbers they canhave decimals so float values and the program gives you the minvalue ou
    8·1 answer
  • Why there isn't in italian this app?​
    15·1 answer
  • Rewrite the following program segment using a while loop instead of a for loop.
    11·1 answer
  • Why is it important to think about the programming language to use?
    8·1 answer
  • Walter is developing a website for the logistics service he offers. He wants to make the website attractive, bright, and visuall
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!