subject
Mathematics, 20.09.2020 07:01 maganns14

Given 4 integers, output their product and their average, using integer arithmetic. Ex: If the input is: 8 10 5 4 the output is: 1600 6 Note: Integer division discards the fraction. Hence the average of 8 10 5 4 is output as 6, not 6.75. Note: The test cases include four very large input values whose product results in overflow. You do not need to do anything special, but just observe that the output does not represent the correct product (in fact, four positive numbers yield a negative output; wow). Submit the above for grading. Your program will fail the last test cases (which is expected), until you complete part 2 below. Part 2 Also output the product and average, using floating-point arithmetic. Output each floating-point value with three digits after the decimal point, which can be achieved by executing cout << fixed << setprecision(3); once before all other cout statements. Ex: If the input is: 8 10 5 4 the output is: 1600 6 1600.000 6.750 Note that fractions aren't discarded, and that overflow does not occur for the test case with large values. answers must provided using C++

ansver
Answers: 2

Other questions on the subject: Mathematics

image
Mathematics, 21.06.2019 18:20, Karamatullah
The number if marbles of different colors stored in a hat is listed below: 4 red marbles 10 green marbles 7 blue marbles. without looking in the hat, dan takes out a marble at random. he replaces the marble and then takes out another marble from the hat. what is the probability that dan takes out a blue marble in both draws?
Answers: 1
image
Mathematics, 21.06.2019 20:00, andrwisawesome0
Aconstruction worker has rope 9 m long he needs to cut it in pieces that are each 3 /5 m long how many such pieces can he cut without having any rope leftover?
Answers: 3
image
Mathematics, 21.06.2019 20:00, chantelporter713
Afamily has five members. a mom, a dad, two sisters, & a brother. the family lines up single file. what is the probabillity that the mom is at the front of the line
Answers: 1
image
Mathematics, 21.06.2019 21:50, victoria6929
The value of the expression 16-^3/4 8 1/8 -6 6 1/40 1/64
Answers: 1
You know the right answer?
Given 4 integers, output their product and their average, using integer arithmetic. Ex: If the input...

Questions in other subjects:

Konu
Mathematics, 10.02.2021 02:10
Konu
History, 10.02.2021 02:10
Konu
History, 10.02.2021 02:10
Konu
Physics, 10.02.2021 02:10
Konu
Arts, 10.02.2021 02:10
Konu
Computers and Technology, 10.02.2021 02:10