Cmis 102 hands-on lab week 5
If we wanted to input 10 students and 5 exams, the first step would be to change the line of code:
“for i in range(5):”
This line is used as a loop which will repeat the same action (in this case, gathering data from user inputs) for a given number of times. In this case, since it is currently set at “range(5)” it will only repeat the action five times but if we wish to allow inputs for 10 students and 5 exams then this needs to be changed to “range(10)”.
The next step would be to adjust the rest of the code accordingly. This could involve changing existing variables or adding additional ones so that they correlate with each student/exam. We may also need to add lines of code that specify how many questions are included on each exam and what types of answers are allowed (multiple choice vs open-ended). Additionally, extra validation checks may need to be added in order ensure all data entered is accurate before being stored into relevant databases.
Overall, when making changes such as these it is essential that one pays close attention not just to individual pieces of code but also their relationship with other components within the program so that any modifications do not lead unintended consequences further down the line.