Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS160 Computer Science I Lab 5: Objective Practice if statements Practice with loops Practice with formatted output Assignment In this lab we will use Python

image text in transcribed

CS160 Computer Science I Lab 5: Objective Practice if statements Practice with loops Practice with formatted output Assignment In this lab we will use Python to ask the user for information about the classes they are taking this semester, and then determine their grade point average (GPA) for that semester. To determine a student's GPA, you divide the number of honor points by the number of attempted credits. To determine honor points, multiple the number of credits by either 4 for an A, 3 for a B, 2 for a C, 1 for a D, or 0 for an F. This program will ignore grades of pass, fail, or incomplete. The program will ask the user for a class. If a class has been entered (such as CS160), ask for the number of credits and the grade. Continue to ask for class, and then the credits and grade, until the user enters nothing for the class. Do not ask for the number of credits and grade if the user does not enter a class. For example, if you received a 4 credit A and a 3 credit B in a semester, for honor points you will earn: 4* 4(A) = 16 3* 3(B) = 9 25 honor points / 7 attempted credits = 3.571429, which will be truncated in the output to 3.571. You can safely assume that no grade other than A, B, C, D, or F will be entered. You cannot assume that the grade will be entered as an upper case letter, if could be a lower case letter. A student's GPA defaults to 0.0 if their GPA cannot be calculated. This is consistent with student GPA's, as discussed in class. Once the user is done entering their classes, print out the following: Grade point average, with 3 places after the decimal point Number of credits attempts Number of credits passed (any grade other than an F) Number of classes attempted Number of classes passed (any grade other than an F) CS160 Computer Science I Lab 5: Objective Practice if statements Practice with loops Practice with formatted output Assignment In this lab we will use Python to ask the user for information about the classes they are taking this semester, and then determine their grade point average (GPA) for that semester. To determine a student's GPA, you divide the number of honor points by the number of attempted credits. To determine honor points, multiple the number of credits by either 4 for an A, 3 for a B, 2 for a C, 1 for a D, or 0 for an F. This program will ignore grades of pass, fail, or incomplete. The program will ask the user for a class. If a class has been entered (such as CS160), ask for the number of credits and the grade. Continue to ask for class, and then the credits and grade, until the user enters nothing for the class. Do not ask for the number of credits and grade if the user does not enter a class. For example, if you received a 4 credit A and a 3 credit B in a semester, for honor points you will earn: 4* 4(A) = 16 3* 3(B) = 9 25 honor points / 7 attempted credits = 3.571429, which will be truncated in the output to 3.571. You can safely assume that no grade other than A, B, C, D, or F will be entered. You cannot assume that the grade will be entered as an upper case letter, if could be a lower case letter. A student's GPA defaults to 0.0 if their GPA cannot be calculated. This is consistent with student GPA's, as discussed in class. Once the user is done entering their classes, print out the following: Grade point average, with 3 places after the decimal point Number of credits attempts Number of credits passed (any grade other than an F) Number of classes attempted Number of classes passed (any grade other than an 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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

LO 16-3 How to integrate visuals and data displays into text.

Answered: 1 week ago

Question

What is the preferred personality?

Answered: 1 week ago