Description
Write a program that reads in pairs of integers and computes the average for each pair. The program should first prompt the user to input the number of pairs of integers to be read. For each pair of integers input by the user, compute and output the average of the two integers.
Example run:
% hw02
How many pairs of integers to be read? 3
--- Iteration 1 ---
Input first value: 12
Input second value: 9
The average for 12 and 9 is 10.5
--- Iteration 2 ---
Input first value: 3
Input second value: 4
The average for 3 and 4 is 3.5
--- Iteration 3 ---
Input first value: 1
Input second value: 2
The average for 1 and 2 is 1.5
%
Homework submission
Turn in the printout of the program and three different test runs. Capture the source code and output into a single file.
Explanation & Answer
Hi,Your pro...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Blink
by Malcolm Gladwell
The Two Towers
by J. R. R. Tolkien
Principles - Life and Work
by Ray Dalio
The Tipping Point
by Malcolm Gladwell
The 5 Love Languages
by Gary Chapman
The Knife of Never Letting Go
by Patrick Ness
Night
by Elie Wiesel
All the Kings Men
by Robert Penn Warren
The Aftermath
by Rhidian Brook