Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ANSWER IN PYTHON ANSWER IN PYTHON 21.6 LAB*: Program: Grade calculator Program Specifications Write a program to calculate a course grade given points for homework,

ANSWER IN PYTHON

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedANSWER IN PYTHON

21.6 LAB*: Program: Grade calculator Program Specifications Write a program to calculate a course grade given points for homework, quizzes, midterm exam, and final exam. Grades are calculated differently for undergrads, grads and distance learners. Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Step 1 (2 pts). Read from input student status (str). If input is not one of "UG" (undergrad), "G" (grad), or "DL" (distance learner), print an error message and exit the program. Otherwise read from input floats for homework points, quiz points, midterm exam score, and final exam score. Calculate each category's average using maximum points for homework (800), quizzes (400), midterm exam (150), and final exam (200). Output category averages as a percentage using print (f"Homework: {homework: 2.1f}%"). Submit for grading to confirm two tests pass. Ex: If the input is: UG 600.0 300.0 120.0 185.0 The output is: Homework: 75.0% Quizzes: 75.0% Midterm: 80.0% Final Exam: 92.5% Ex: If the input is: TL 600 300 120 180 The output is: Error: student status must be UG, G or DL Step 2 (2 pts). Set any average to 100% if average is above 100%. Submit for grading to confirm three tests pass. Ex: If the input is: UG 700.0 300.0 200.0 205.0 The output is: Homework: 87.5% Quizzes: 75.0% Midterm: 100.0% Final Exam: 100.0% Step 3 (2 pts). Calculate the course average based on student status using the table below. Output the course average. Submit for grading to confirm five tests pass. Category UG G DL Homework 20% 15% 5% Quizzes 20% 5% 5% Midterm 30% 35% 40% Final Exam 30% 45% 50% Ex: If the input is: G 800.0 400.0 100.0 100.0 The output is: Homework: 100.0% Quizzes: 100.0% Midterm: 66.7% Final Exam: 50.0% G average: 65.8% Step 4 (4 pts). Identify the course letter grade based on the course average using the table below. Output the course letter grade. Submit for grading to confirm all tests pass. Average Grade at least 90.0 A at least 80.0 and less than 90.0 B at least 70.0 and less than 80.0 C at least 60.0 and less than 70.0 D less than 60.0 F Ex: If the input is: DL 600.0 300.0 120.0 150.0 The output is: Homework: 75.0% Quizzes: 75.0% Midterm: 80.0% Final Exam: 75.0% DL average: 77.0% Course grade: C 1: Compare output 0/1 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input UG 600.0 300.0 120.0 185.0 Your output starts with Your program produced no output Expected output starts with Homework: 75.0% Quizzes: 75.0% Midterm: 80.0% Final Exam: 92.5% 2: Compare output 0/1 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input TL 600.0 300.0 120.0 185.0 Your output your program produced no output Expected output Error: student status must be UG, Gor DL 3: Compare output A 0/2 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input DL 900.0 300.0 200.0 205.0 Your output starts with Your program produced no output Expected output starts with Homework: 100.0% Quizzes: 75.0% Midterm: 100.0% Final Exam: 100.0% 4: Compare output ^ 0/1 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input DL 600.0 350.0 110.0 190.0 Your output starts with Your program produced no output Expected output starts with Homework: 75.0% Quizzes: 87.5% Midterm: 73.3% Final Exam: 95.0% DL average: 85.0% 5: Compare output a 0/1 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax G Input 1000.0 1000.0 100.0 100.0 Your output starts with Your program produced no output Expected output starts with Homework: 100.0% Quizzes: 100.0% Midterm: 66.78 Final Exam: 50.0% Gaverage: 65.8% 6: Compare output A 0/1 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input DL 600 300 120 150 Your output Your program produced no output Expected output Homework: 75.0% Quizzes: 75.0% Midterm: 80.0% Final Exam: 75.0% DL average: 77.0% Course grade: C 7: Compare output 0/1 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input G 720.0 360.0 135.0 180.0 Your output Your program produced no output Expected output Homework: 90.0% Quizzes: 90.0% Midterm: 90.0% Final Exam: 90.0% G average: 90.0% Course grade: A 8: Compare output A 0 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input UG 640.0 320.0 120.0 160.0 Your output your program produced no output Expected output Homework: 80.0% Quizzes: 80.0% Midterm: 80.0% Final Exam: 80.0% UG average: 80.0% Course grade: B 9: Compare output ^ 07 File "main.py", line 6 String str, grade=""; SyntaxError: invalid syntax Input UG 475.0 240.0 90.0 120.0 Your output Your program produced no output Expected output Homework: 59.4% Quizzes: 60.0% Midterm: 60.0% Final Exam: 60.0% UG average: 59.9% Course grade: F

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

More Books

Students also viewed these Databases questions

Question

a. Describe the encounter. What made it intercultural?

Answered: 1 week ago