Problem |
Hints |
Solution |
- Write a function that prompts the user for and reads 10 integers, one at a time, and returns the largest integer. The user may enter any legal integer value. Use a for-loop.
|
max1 hints
|
max1 |
- Write a function that prompts the user for and reads integers one at a time and returns the largest integer. The user enters a -1 to end input. All other data values entered are non-negative (i.e., 0 or positive). Return -1 if the user enters no data. Use a while-loop.
|
max2 hints
|
max2 |
- Write a function that prompts the user for and reads integers one at a time and returns the largest integer. The user enters a -1 to end input. All other data values entered are non-negative (i.e., 0 or positive). Return -1 if the user enters no data. Use a do-while-loop.
|
max3 hints
|
max3 |
- Write a function that prompts the user for and reads 10 integers one at a time and returns the average of the numbers. The user may enter any legal integer value. Use a for-loop.
|
Average definition & problem hints
|
ave1 |
- Write a function that prompts the user for and reads integers one at a time and returns the average of the numbers. The user enters a -1 to end input. All other data values entered are non-negative (i.e., 0 or positive). Return -1 if the user enters no data. Use a while-loop.
|
ave2 |
- Write a function that prompts the user for and reads integers one at a time and returns the average of the numbers. The user enters a -1 to end input. All other data values entered are non-negative (i.e., 0 or positive). Return -1 if the user enters no data. Use a do-while loop.
|
ave3 |