Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am having trouble implementing a for loop for a python program that reads input from the user for a student's grades on homework and

I am having trouble implementing a for loop for a python program that reads input from the user for a student's grades on homework and three exams, and uses them to compute the student's total score. Based on the total score, the program will print out the corresponding letter grade and encouraging comments for the student here are the set of instructions given. .

image text in transcribed

image text in transcribed

image text in transcribed

Implementations 1) The program begins with an introduction message that briefly explains the program to the user. 2) Each category is weighted-points for each category is scaled up to a fraction of the one hundred percent (100%) grade for the course. As the program begins reading each category, it first prompts for the category's weight, then the score earned for the category, followed by the calculated total points and weighted score. 3) The user begins by entering scores earned on Exam 1 and the weight of Exam 1. (Note: the total score of an exam is 100 points.) Then output the total points and weighted scores for Exam 1. The weighted score equal to the user's score multiplied by the exam's weight. For example, Total points: 78 Weight for Exam 1: 10 Weighted score: 78/100 * 10 = 7.8 (NOTE: user input is bold and underlined in the example.) 4) Next, the program prompts the user to input data about Exam 2 and then about the Exam 3. The behavior for each is the same as the behavior for Exam 1. Note: for steps 3) and 4), use a loop instead of repeatedly writing the same code to get user input and calculate the grade. 5) Next, the user enters information about the student's homework, including the weight and how many assignments were given. For each assignment, the user enters a score and max points for that assignment. Use a cumulative sum. See example, Homework: Weight (0-100)? 50 Number of assignments? 3 Assignment 1 score? 14 Assignment 1 max points? 15 Assignment 2 score? 17 Assignment 2 max points? 20 Assignment 3 score? 19 Assignment 3 max points? 25 (NOTE: user input is bold and underlined in the example.) Note: for step 5, use a loop instead of repeatedly writing the same code to get user input and calculate the grade. 6) Part of the homework score comes from sections attended. To simplify the formula, assume that each section attended is worth 3 points, up to a maximum of 34 points. For example, How many sections did you attend? 10 Attendance points = 30/34 (NOTE: user input is bold and underlined in the example.) 7) After collecting all the data for the homework assignments and attendance, the program prints out the total points and weighted scores for the homework. 8) Once the program has read the user information for the homework and three exams, it prints out the student's overall percentage earned in the course, which is the sum of the weighted scores (round the score to show one digit after the decimal point) from the four categories, see the formula below: Grade = Weighted MatermScoret Weighted Mtern Scoret WeightedFnalExam Scce+ WeightedHoneworkSco 78 84 14+17+19+(10x3) Grade (170 x 15+20+25+ 34 Grade = 7.8+8.4+30.0+ 426 Grade = 88.8 *70)+(100*10) +(100*30) + (" 2x50 9) The program prints out a letter grade the student will get in the course, based on the following scale. 90% and above: A 89.99% - 80% B 79.99% - 70%: 69.99% - 60%: D under 60%: F 10) After showing the user their letter grade, print a custom message of your choice about the grade they get. This message should be different for each grade range shown above. It should be at least 1 line of any non-offensive text you like. . . . Development Strategy and Hints: A student can receive extra credit on an individual assignment, but the total points for each homework are capped at the maximum possible. For example, a student can receive a score of 22/20 on one homework assignment, but if their total homework score for all assignments is 63/60, this score should be capped at 60/60. Section points for attendance are capped at 34. Exam scores are capped at 100. You can use min() function to constrain numbers to within a particular bound. Otherwise, you may assume the user enters valid input. When prompted for a value, the user will enter an integer in the proper range. The user will enter a number of homework assignments 2 1, and the sum of the four categories' weights will be exactly 100. The weight of each category will be a non-negative number. Tackle parts of the program (exam 1, exam 2, exam 3, and homework) one at a time, rather than writing the entire program at once. Write a bit of code, get it to run, and test what you have so far. If you try to write large amounts of code without attempting to run it, you may encounter a large list of errors and/or bugs. To compute homework scores, you will need to cumulatively sum not only the total points the student has earned, but also the total points possible on all homework assignments. All weighted scores and grades are printed with no more than 1 digit after the decimal point. You can achieve this with the round function. The following code prints variable x rounded to the nearest tenth: x = 1.2345 print("x rounded to the nearest tenth is " + round(x, 1))

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

4. Does cultural aptitude impact ones emotional intelligence?

Answered: 1 week ago