Are you having trouble figuring out how many test cases are supposed to be in your program? Never fear, this example has been created just for YOU!
The Rule:
If you have to enter data from the keyboard while your program is running, then you should only have one test case. If you don't enter data, then you should have all the test cases shown in the lab directions. See examples below.
Example #1:
See how the Sample Output shows the word Enter? This is your clue that you are going to be entering data from the keyboard!!
Complete program output:
Do you see how there is only one data set, not three? This is because data was typed in from the keyboard while the program was running.
But what about if there is a comment in the starting file that says "add more data sets"?? Delete this and ignore it!
But what about if there are 100 Sample Outputs shown in the directions for the lab? Refer to the rule! Multiple examples are shown just to give you more examples to test if the one input and output of your program is correct.
Please Note: Data that is not part of any Sample Output will be used to test and grade your program. Your program needs to work with this unknown data.
Example 2:
See how the Sample Output does not show the word Enter or anything else to indicate that data is going to get typed in? This means that all of the samples outputs need to be part of your program output!
Complete program output:
Well there you have it. Hopefully, this will help you get better grades on your lab assignments!