This project will allow the student to understand and develop a program using critical steps to include a program description, test plan, analysis and design using both pseudocode and a flow chart in order to enhance the image and understanding of project.
Program Description:
This program will find the number of students in a computer algorithm course. The program will ask user to 6 integers. The design step will use both flowchart and pseudocode for better understanding.
Analysis:
I will use sequential, selection and repetition programming statements.
I will define three integer numbers: count, value, and sum. Count will store how many times values are entered to make sure we don’t exceed 6 values. Value will store the input integer and sum will store the running sum.
The sum will be calculated by this formula:
Sum=sum+value
Values and sum can be input and calculated within a repetition loop:
while count<6
count=count+1
Input value
sum=sum+value
End while
The additional selection statement will be of this form:
if sum >10 then
print “sum is over 10”
End if
Test plan:
(
Test Case
Input
Expected Output
Value=1 Sum=10
Value=2
Value=3
Value=2
Value=0
Value=2
)
(
Test Case
Input
Expected Output
Value=1 Sum=13
Value=2
Value=3
Value=2
Value=3
Value=2
)
(
Test Case
Input
Expected Output
Value=4
Sum=15
Value=3
Value=2
Value=1
Value=3
Value=2
)