+
CHANGE THE CODE TO AVERAGE 20 INTEGERS AS OPPOSED TO 10. SUPPORT YOUR EXPERIMENTATION

CHANGE THE CODE TO AVERAGE 20 INTEGERS AS OPPOSED TO 10. SUPPORT YOUR EXPERIMENTATION

Rating:
Rating
(0)
Author: Joyce Buda
Description:

http://theperfecthomework.com/change-the-code-to-average-20-integers-as-opposed-to-10-support-your-experimentation-with-screen-captures-of-executing-the-new-code/

Learning Exercises for you to complete
1. Change the code to average 20 integers as opposed to 10. Support your experimentation with screen captures of executing the new code.
2. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created after step 1.
3. What happens if you entered a value other than an integer? (For example a float or even a string). Support your experimentation with screen captures of executing the code.
4. Modify the code to allow the user to enter an unspecified number of positive integers and calculate the average. In other words, the user could enter number of positive integers. (Hint:You can prompt the user for how many they want to enter. Or; you could use a sentinel value to trigger when the user has completed entering values). You may need to conduct some research on your own to solve this problem. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created. Support your experimentation with screen captures of executing the new code.


(more)
See More
Try a College Course Free

Sophia’s self-paced online courses are a great way to save time and money as you earn credits eligible for transfer to over 2,000 colleges and universities.*

Begin Free Trial
No credit card required

25 Sophia partners guarantee credit transfer.

221 Institutions have accepted or given pre-approval for credit transfer.

* The American Council on Education's College Credit Recommendation Service (ACE Credit®) has evaluated and recommended college credit for 19 of Sophia’s online courses. More than 2,000 colleges and universities consider ACE CREDIT recommendations in determining the applicability to their course and degree programs.

Tutorial