Question: 1 . 2 9 LAB: Variables / Assignments: Simple statistics Part 1 Given 3 integers, output their average and their product, using integer arithmetic. Ex:
LAB: VariablesAssignments: Simple statistics
Part
Given integers, output their average and their product, using integer arithmetic.
Ex: If the input is:
the output is:
Submit the above for grading. Your program will fail the test cases which is expected until you complete part below but check that you are getting the correct average and product using integer division.
Part
Using the same integers, output the average and product, using floatingpoint arithmetic.
Output all floatingpoint numbers with five digits after the decimal point, which can be achieved as follows:
Put x to output with decimal places
Ex: If the input is:
the first line of output uses integer arithmetic and the second line output uses floatingpoint arithmetic:
the current coral code i do have is
Declare variables at the top
integer num
integer num
integer num
integer average
integer product
Input values
num Get next input
num Get next input
num Get next input
Calculate average and product
average num num num
product num num num
Output results
Put average to output
Put to output
Put product to output
Put
to output
Declare variables for floatingpoint numbers at the top
float fnum
float fnum
float fnum
float faverage
float fproduct
Input values
fnum num
fnum num
fnum num
Calculate average and product
faverage fnum fnum fnum
fproduct fnum fnum fnum
Output results with some added space to match expected format
Put faverage to output
Put to output
Put fproduct to output
I am attempting to get their answers expected i am just stuck on some of the code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
