User will enter three grades averages (exam, project, and lab). Determine which of the three grades (consider any ties) is the highest grade

Question

User will enter three grades averages (exam, project, and lab). Determine which of the three grades (consider any ties) is the highest grade and display the results. Determine which of the three grades (consider any ties) is the lowest grade and display the results. Check for any grades failing below 70% and display each individual grade. Calculate the average grade using the three grades and display the average grade. If they are all 70 and above then display the fact that they are all 70% or above.

in progress 0
Edana Edana 2 months 2021-07-23T17:29:45+00:00 1 Answers 0 views 0

Answers ( )

    0
    2021-07-23T17:31:29+00:00

    Answer:

    In Python:

    exam = int(input(“Exam: “))

    project = int(input(“Project: “))

    lab = int(input(“Lab: “))

    if exam >= project and exam >= lab:

       print(“Highest Grade: “+str(exam))

    elif project >= exam and project >= lab:

       print(“Highest Grade: “+str(project))

    else:

       print(“Highest Grade: “+str(lab))

       

    if exam <= project and exam <= lab:

       print(“Lowest Grade: “+str(exam))

    elif project <= exam and project <= lab:

       print(“Lowest Grade: “+str(project))

    else:

       print(“Lowest Grade: “+str(lab))

       

    print(“\nGrades below 70”)

    if exam < 70:

       print(“Exam: “+str(exam))

    if project < 70:

       print(“Project: “+str(project))

    if lab < 70:

       print(“Lab: “+str(lab))

       

    print(“\nAverage: “+str((exam+project+lab)/3))

    if exam > 70 and project >70 and lab > 70:

       print(“All grades are above 70”)

    Step-by-step explanation:

    The next three lines get input for exam, project and lab

    exam = int(input(“Exam: “))

    project = int(input(“Project: “))

    lab = int(input(“Lab: “))

    This condition checks if exam is the highest grade

    if exam >= project and exam >= lab:

    If true, exam is printed as the highest grade

       print(“Highest Grade: “+str(exam))

    This condition checks if project is the highest grade

    elif project >= exam and project >= lab:

    If true, project is printed as the highest grade

       print(“Highest Grade: “+str(project))

    If otherwise

    else:

    lab is printed as the highest grade

       print(“Highest Grade: “+str(lab))

    This condition checks if exam is the lowest grade    

    if exam <= project and exam <= lab:

    If true, exam is printed as the lowest grade

       print(“Lowest Grade: “+str(exam))

    This condition checks if project is the lowest grade    

    elif project <= exam and project <= lab:

    If true, project is printed as the lowest grade

       print(“Lowest Grade: “+str(project))

    If otherwise

    else:

    lab is printed as the lowest grade

       print(“Lowest Grade: “+str(lab))

       

    This prints the header “Grades below 70”

    print(“\nGrades below 70”)

    This checks if exam is below 70.

    if exam < 70:

    If true, exam score is printed

       print(“Exam: “+str(exam))

    This checks if project is below 70

    if project < 70:

    If true, project score is printed

       print(“Project: “+str(project))

    This checks if lab is below 70

    if lab < 70:

    If true, lab score is printed

       print(“Lab: “+str(lab))

       

    This calculates and prints the average

    print(“\nAverage: “+str((exam+project+lab)/3))

    This checks if all three scores are above 70

    if exam > 70 and project >70 and lab > 70:

    If true, the the message that all are above 70, is printed

       print(“All grades are above 70”)

Leave an answer

Browse

Giải phương trình 1 ẩn: x + 2 - 2(x + 1) = -x . Hỏi x = ? ( )