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
When IPv4 addressing is manually configured on a web server, which property of the IPv4 configuration identifies the network and
makvit [3.9K]

Answer:

subnet mask

Explanation:

A subnetwork or subnet mask is a logical subdivision of an IP network.

To find out your subnet mask, the simlest way around it is to is to run a simple command line in windows.

Simply press the Windows key and “R” at the same time to open the command prompt and type “cmd” followed by “enter.” This will allow you to see your subnet mask.

In IPv4, the subnet mask 255.255. 255.0 is 32 bits and consists of four 8-bit octets. The address: 10.10. 10.0 subnet mask 255.255.255.0 this simply indicated that the subnet mask consists of a range of IP addresses from 10.10.10.0 - 10.10.10.255.

Subnet masks (IPv4) are often involved in identifying the range of IP addresses that make up a subnet, it can also be described as a group of IP addresses on the same network.

7 0
3 years ago
Drag each connector name to match the connector type shown.
Setler79 [48]

Answer:

The first one is usb-c, the second is mini-usb, the third is micro-usb.

Explanation:

8 0
3 years ago
Look at the following structure declaration.
myrzilka [38]

Answer:

B. a tag

Explanation:

In the structure definition given below:

struct Employee

{

string name;

int idNum;  

};

Employee corresponds to the tag of the structure. The tag is used to create additional instances of the structure. For example:

struct Employee e1;

struct Employee e2;

name and idNum are members of the Employee structure and are referenced using the dot notation. e.g.,

struct Employee e1;

e1.idNum=1;

7 0
3 years ago
Research the design basis threat (DBT) in terms of Cybersecurity for an organization of your choice. Discuss what the Cybersecur
tiny-mole [99]

A Design Basis Threat (DBT) is known to be a characteristics of any given or potential insider and also those of external adversaries, that may try to have or gain unauthorized removal or sabotage, against a physical protection system that was set up designed and evaluated.

<h3>What are Cybersecurity objectives?</h3>

Cybersecurity aims are:

  • To protect computer system,
  • To protect networks,
  • To protect software programs from such cyber attacks.

Note that a lot of digital attacks are targeted at accessing, changing, or deleting sensitive information as well as others.

Learn more about IT from

brainly.com/question/1276995

#SPJ1

3 0
1 year ago
What are some ways you can work with templates? Check all that apply.
yaroslaw [1]
What are some ways you can work with templates? Check all that apply.

Answer: (A,D,E) see picture below for help also.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which category of app does word processing software fall into? A. Productivity B. Entertainment C. Social networking D. Educatio
    14·2 answers
  • PLEASE HELP ITS DRIVERS ED
    8·2 answers
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    8·1 answer
  • What is not true about contracts?
    12·2 answers
  • Which of the following are characteristics of algorithms? Choose all that apply. They take a step-by-step approach to performing
    12·1 answer
  • Two technicians are discussing a parasitic load test. Technician A says that the parasitic load is measured with an ammeter Tech
    13·1 answer
  • Electrical data suitable for transmission is called a(n)
    5·1 answer
  • Capstone Project part 11 quiz
    6·1 answer
  • Choose the missing term.
    14·1 answer
  • How many accelerometers are there in an IRS system?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!