Quizzma Latest Questions

For this final, you will be writing a program that will compute a user’s semester grade. A semester grade is calculated with the following weighted quarters and final: quarter 1 – 40%, quarter 2 – 40%, and the semester final – 20%. Once calculated, you must add them together and print out the user’s grade for the semester, not just their percent. Use the float function when getting input. The grades are as follows: A: 89-100 B: 79 – 88 C: 69-78 D: 59-68 F: <58

For this final, you will be writing a program that will compute a user’s semester grade. A semester grade is calculated with the following weighted quarters and final: quarter 1 – 40%, quarter 2 – 40%, and the semester final – 20%. Once calculated, you must add them together and print out the user’s grade for the semester, not just their percent. Use the float function when getting input. The grades are as follows:

A: 89-100
B: 79 – 88
C: 69-78
D: 59-68
F: <58




Leave an answer

Leave an answer

What is the capital of Egypt? ( Cairo )

1 Answer

  1. To compute a user’s semester grade based on quarter grades and the final exam, you’ll want to follow these steps in your program:

    1. Get the grades as input: Use the `float()` function to ensure the input is treated as a number (a float).
    2. Apply weights to the grades: Multiply each quarter grade by its respective weight and the final grade by its weight.
    3. Calculate the total grade: Add the weighted grades together.
    4. Determine the letter grade: Use conditionals to convert the total percentage into a letter grade.

    Here’s an example code snippet in Python:

    
    

    # Input grades from the user

    quarter1 = float(input("Enter Quarter 1 grade: "))

    quarter2 = float(input("Enter Quarter 2 grade: "))

    final_exam = float(input("Enter Final Exam grade: "))

    # Calculate weighted grades

    weighted_q1 = quarter1 * 0.4

    weighted_q2 = quarter2 * 0.4

    weighted_final = final_exam * 0.2

    # Calculate total semester grade

    total_grade = weighted_q1 + weighted_q2 + weighted_final

    # Determine letter grade

    if total_grade >= 89:

    letter_grade = 'A'

    elif total_grade >= 79:

    letter_grade = 'B'

    elif total_grade >= 69:

    letter_grade = 'C'

    elif total_grade >= 59:

    letter_grade = 'D'

    else:

    letter

Related Questions