Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

1. Demonstrate you successfully followed the steps in this lab

1. Demonstrate you successfully followed the steps in this lab by

preparing screen captures of yourunning the lab as specified in the Instructions above.
2. Change the code to average 20 integers as opposed to 10. Support your experimentation withscreen captures of executing the new code.
3. Prepare a new test table with at least 3 distinct test cases listing input and expected output forthe code you created after step 1.
4. What happens if you entered a value other than an integer? (For example a float or even astring). Support your experimentation with screen captures of executing the code.
5. Modify the code to allow the user to enter any number of positive integers and calculate theaverage. In other words, the user could enter any number of positive integers. (Hint: You canprompt the user for how many they want to enter. Or; you could use a sentinel value to triggerwhen the user has completed entering values). Prepare a new test table with at least 3 distincttest cases listing input and expected output for the code you created. Support yourexperimentation with screen captures of executing the new code.

1CMIS 102 Hands-On LabWeek 5OverviewThis hands-on lab allows you to follow and experiment with the critical steps of developing a programincluding the program description, analysis, test plan, design (using pseudocode), and implementationwith C code.The example provided uses sequential, selection and repetition statements.Program DescriptionThis program will calculate the average of 10 positive integers. The program will ask the user to 10integers. If any of the values entered is negative, a message will be displayed asking the user to enter avalue greater than 0. The program will use a loop to input the data.AnalysisI will use sequential, selection and repetition programming statements.I will define two integer numbers: count, value and sum. count will store how many times values areentered. value will store the input. Sum will store the sum of all 10 integers.I will define one double number: avg. avg will store the average of the ten positive integers input.The sum will be calculated by this formula:sum = sum + valueFor example, if the first value entered was 4 and second was 10:sum = sum + value = 0 + 4sum = 4 + 10 = 14Values and sum can be input and calculated within a repetition loop:while count <10Input valuesum = sum + valueEnd whileAvg can be calculated by:avg = value/countA selection statement can be used inside the loop to make sure the input value is positive.If value >= 0 thencount = count + 1Elseinput valueEnd If
Background image of page 1
2Test PlanTo verify this program is working properly the input values could be used for testing:Test CaseInputExpected Output1value=1value=1value=1value=0value=1value=2value=0value=1value=3value=2Average = 1.22value=100value=100value=100value=100value=100value=200value=200value=200value=200value=200Average = 150.03value=100value=100value=100value=100value=-100value = 100value=200value=200value=200value=200Input a positive valueaverage is 140.0Pseudocode// This program will calculate the average of 10 positive integers.// Declare variablesDeclare count, value, sum as IntegerDeclare avg as double//Initialize valueSet count=0
Background image of page 2

Show 

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"