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
Rachel wants to use Microsoft Query to retrieve data from her corporate databases and files so that she doesn't have to retype t
Minchanka [31]

Answer:

Option: True

Explanation:

Microsoft Query can be used to retrieve data from external source such as databases. There are lots of databases or data sources which are accessible such as Microsoft Access, Microsoft Excel, Microsfot SQL Server OLAP Services, Oracle, Paradox, text file etc.

The steps mentioned in the question are correct. After finishing all the steps, user shall see the name of the data source will appears in the Choose Data Source dialog box.

8 0
3 years ago
Determine the hexadecimal value of a mask that can be used to complement the values of thefirst and third bits of f1ag and leave
Makovka662 [10]

Answer:

Let our mask be 1010000...000. Notice that, if we apply XOR operation to any number with this mask, the first and third bits will be complemented and all other bits will be unchanged. Since for each individual bit, XOR with 0 does not change the value of bit and XOR with 1 changes the value of bit.

Explanation:

To give a hexadecimal number, we should know the number of bits in representation of number.

8 0
4 years ago
What will the following code display? int numbers[4] = { 99, 87 }; cout &lt;&lt; numbers[3] &lt;&lt; endl; a. 87 b.0 d. 34. What
pishuonlain [190]

Answer:

1. The output is 0

2. Each element in the array is initialized to 0.0

Explanation:

Solving (a): The output of the code

We have:

<em>int numbers[4] = { 99, 87 }; </em>

<em>cout << numbers[3] << endl;</em>

<em />

The first line initializes the 0 and 1 index of the array to 99 and 87, respectively.

Other elements will be 0, by default.

So, the following code segment will output 0

<em>cout << numbers[3] << endl; </em>

<em />

Solving (b): What the given code will do?

The first and second line declares an array of 5 elements

However, the following iteration will only initialize the array with 0.0 starting from the second

<em>for(int i = 2; i <= SIZE; i++) { x[i] = 0.0; }</em>

<em />

Because, the counter is initialized to start from the second index.

7 0
3 years ago
01:24:3
bogdanovich [222]

Answer:

1. Uncompressed audio formats

2. Formats with lossless compression

3. Formats with lossy compression

Explanation:

1. Uncompressed audio formats, such as WAV, AIFF, AU or raw header-less PCM;

2. Formats with lossless compression, such as FLAC, Monkey's Audio (filename extension .ape), WavPack (filename extension .wv), TTA, ATRAC Advanced Lossless, ALAC (filename extension .m4a), MPEG-4 SLS, MPEG-4 ALS, MPEG-4 DST, Windows Media Audio Lossless (WMA Lossless), and Shorten (SHN).

3. Formats with lossy compression, such as Opus, MP3, Vorbis, Musepack, AAC, ATRAC and Windows Media Audio Lossy (WMA lossy).

8 0
4 years ago
You have video-recorded a friend’s birthday party. You compressed the video so it uploads quickly. What are some signs that you
Hatshy [7]

Answer:

(A) graphical glitches (B) choppy frames (D) sound that does not match motion

Explanation:

I did the assignment and (A) (B) (D) were correct.

                                           hope it helps

4 0
3 years ago
Other questions:
  • Physical parts of components of a computer system is called
    9·1 answer
  • If you're found to be at fault in _____, your driver license will be canceled within 90 days unless you complete a 12-hour Advan
    10·2 answers
  • Soo...My Old 3DS XL haven't been touched in around a year...So i tried to charge it but no LED lights opened..Even the power but
    14·1 answer
  • What is an electronic path over which data can travel.
    7·1 answer
  • Most of the international operations in a computer use hexadecimal numbering. True Or False
    5·1 answer
  • When would you use the AutoFit to Contents option?
    15·1 answer
  • How to delete Brainly account ?​
    12·1 answer
  • The following procedure is intended to return the number of times the value val appears in the list nylist. The procedure does n
    15·2 answers
  • Fill in the blank: A keyword set to _____ match type will display your ad if the search term contains the same order of the word
    10·1 answer
  • In addition to letting people share files, what is the most useful feature of
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!