Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given 3 integers, output their sum, average, and product, using integer arithmetic. Ex: If the input is 10205 , the output is: 35111000 Note: Integer

image text in transcribed
image text in transcribed
Given 3 integers, output their sum, average, and product, using integer arithmetic. Ex: If the input is 10205 , the output is: 35111000 Note: Integer division discards the fraction. Hence the average of 10205 is output as 11 , not 11.6667. Note, Remember to declare 3 integer variables: Note: The test cases include three 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, three positive numbers yield a negative output; wow) Submit the above for grading. Your program will fail the last test cases (which is expected), untilyou complete part 2 and 3 below. Part 2 Also cutput the sum, average and product, using floating-point arithmetic. Ex. If the input is 10205 , the output is: 35351111.666710001000 Note that fractions arent discarded, and that overflow does not occur for the test case with large values. Part 3 Finally, output the distance of each number from the average, using integer arithmetic Ex If the input is 10205 , the output is: 3535191111.6667610001000 Note: All numbers are positive and use the integer average (ex(2011)=9 not (2011.6667)=8.3333=8 Note All numbers are positive and use the integer average ( ex: (2011)=9 not (2011.6667)=8.3333=8 \begin{tabular}{l|l} \hline AB & 2 23.1. LAB, Simple statistics \end{tabular} main.cpp 1 \#include ciostreams 2 \#include main(){ 6. 7 Type your code here. % 98 10 11 12 return : 13]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions