Problem Statement:

You are tasked with creating a simple program to calculate and display the grades of students based on their scores. The program should follow a procedural programming approach, meaning it should be divided into separate procedures or functions.

Requirements:

  1. Create a procedure named calculate_grade that takes a student's score as input and returns their grade according to the following grading scale:
    • 90-100: A
    • 80-89: B
    • 70-79: C
    • 60-69: D
    • Below 60: F
  2. Create a procedure named get_student_info that prompts the user for the student's name and score, and returns these values as a tuple.
  3. Create a procedure named display_grade that takes a student's name, score, and grade as inputs and displays the following message:
    • "Student [student_name] scored [student_score] and received a grade of [student_grade]."
  4. Create a main procedure called main that:
    • Repeatedly calls get_student_info to get information about multiple students until the user decides to stop (for example, by typing "exit" or a similar command).
    • For each student, call the calculate_grade procedure to determine the grade.
    • Call the display_grade procedure to display the student's name, score, and grade.

Additional Guidelines:

  • Use a loop to repeatedly get student information until the user decides to exit.
  • Handle invalid inputs gracefully, such as non-numeric scores or incorrect grade ranges.
  • Provide a clear way for the user to exit the program.
  • Organize your code into functions as described above.

Sample Output:

Welcome to the Student Grade Calculator!

Enter student name (or type 'exit' to quit): Alice

Enter student score: 92

Student Alice scored 92 and received a grade of A.

Enter student name (or type 'exit' to quit): Bob

Enter student score: 75

Student Bob scored 75 and received a grade of C.

Enter student name (or type 'exit' to quit): exit Goodbye!