Objective

Use the repetition control structure to write code in Raptor to calculate letter grade for a course for a set of students. DO NOT use the array. A Program that uses arrays for this exercise WILL NOT be accepted.

Process and additional criteria

Ask for the number of students in a course. Make sure the user enters 1 or more students. Must use a loop to validate. For each student,

  • Ask the user for the number of assignments given in a course. Make sure the user enters 1 or more assignments. Must use a loop to validate.
  • Ask the user for the score on each assignment and calculate the average assignment score. Make sure that the user enters a valid test score (values between 0 and 100).
  • Ask the user for grade for 2 exams and the final exam. You don't have to validate the exam scores.
  • Calculate the overall grade by: (assignment average * .65) + exam1 * .10 + exam2.1+ Final Exam *.15.
  • Calculate and display the final letter grade based on the following table.
A-90-100
B-80-less than 90
C-70- less than 80
D-60- less than 70
F-Less than 60

Sample run

Enter the number of students: -1
Invalid - try again
Enter the number of students: -5
Invalid - try again
Enter the number of students: 2
Enter the number of assignments: -1
Invalid - try again
Enter the number of assignments: -2
Invalid - try again
Enter the number of assignments: 3
Enter the score for the assignment: 200
Invalid - try again
Enter the score for the assignment: -2
Invalid - try again
Enter the score for the assignment: 90
Enter the score for the assignment: 80
Enter the score for the assignment: 70
Enter grade for exam 1: 73
Enter grade for exam 2: 84
Enter grade for final exam: 92
Overall grade: 81.5
Letter grade: B
Enter the number of assignments: 2
Enter the score for the assignment: 90
Enter the score for the assignment: 80
Enter grade for exam 1: 73
Enter grade for exam 2: 84
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.