Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
Suppose you are writing code to process data from a questionnaire. One of the questions is what grade are you in? The code look...Question
Suppose you are writing code to process data from a questionnaire. One of the questions is what grade are you in? The code looks as given below.
gr = int(input("What grade are you in? "))
if (gr == 9):
print("Freshman")
elif (gr == 10):
print("Sophomore")
elif (gr == 11):
print("Junior")
elif (gr == 12):
print("Senior")
else:
print("Not in High School")
In 1-2 sentences, describe the data points that you should test to make sure that program is working properly.
gr = int(input("What grade are you in? "))
if (gr == 9):
print("Freshman")
elif (gr == 10):
print("Sophomore")
elif (gr == 11):
print("Junior")
elif (gr == 12):
print("Senior")
else:
print("Not in High School")
In 1-2 sentences, describe the data points that you should test to make sure that program is working properly.
Answers
There are no human answers yet.
Answered by
GPT-4o mini
To ensure the program functions correctly, you should test valid grade inputs (9, 10, 11, 12) to confirm that the appropriate class names are printed, as well as invalid inputs (e.g., numbers outside the high school range like 8, 13, or negative numbers) to verify that it outputs "Not in High School." Additionally, testing with non-integer inputs (like strings or float values) should also be conducted to ensure the program handles exceptions properly.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.