Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this program, you are going to ask the user how many integers they want to input, store them, output the list, and output the

For this program, you are going to ask the user how many integers they want to input, store them, output the list, and output the average of the list.
Details:
The program should contain a function for prompting the user for how many integers they want to store
The number of integers stored must be at least 1
If the user enters bad data, they should be told it's bad and be allowed to enter another integer
The program should contain another function that prompts the user for the integers they want to store
The numbers entered by the user must be integers
This function should have an input parameter with a default value. The default value should be used for each integer request except the last one which should override the parameter with something like "Enter your last integer: "
If the user enters bad data, they should be told it's bad and be allowed to enter another integer
Once the user has entered the correct number of integers, the program should print the list of integers
The program should then print the average value of the integers in the list
Along with your working program, you must also submit your working unit tests for your functions.
Your unit tests should assert that bad input raises the expected errors.

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions