Answer:
Foxy
Explanation:
Cause he's cool and he's my favorite.
7.5 Code practice Plz answer ASAP
def calculate_GPA(grade, weight):
grades = {"A": 4, "B": 3, "C": 2, "D": 1, "F": 0}
if weight == 0:
return grades[grade]
else:
return grades[grade] + 1
classes = int(input("How many Classes are you taking? "))
total = 0
for x in range(classes):
letter = input("Enter your Letter Grade: ")
user_weight = int(input("Is it weighted? (1 = yes) "))
grade = calculate_GPA(letter, user_weight)
total += grade
print("Your GPA score is: ", grade)
print("Your weighted GPA is a",(total/classes))
I wrote my code in python 3.8. I was able to replicate the output in your picture exactly. If you need me to make any changes, I'll do my best.
The function is an illustration of for loops
For loops are used to perform repetitive operations; just like the while loop
The program in Python, where comments are used to explain each line is as follows:
#This defines the studentGPA function
def studentGPA(grade, weight):
#This initializes a dictionary for all grades
allGrade = {"A": 4, "B": 3, "C": 2, "D": 1, "F": 0}
#This sets the return grade to 0
retValue = 0
#If the grade is valid
if grade in allGrade:
#If the weight is 0
if weight == 0:
#Then score is not graded
retValue = allGrade[grade]
#If otherwise
else:
#This adds 1 to the return grade
retValue = allGrade[grade]+1
#This returns the grade point
return retValue
#The main begins here
#This gets the number of classes
klass = int(input("How many Classes are you taking? "))
#This initializes the total grade to 0
total = 0
#This following is repeated for each class
for x in range(klass):
#This gets input for the letter grade
letterGrade = input("Enter your Letter Grade: ")
#This gets input for the weight
weight = int(input("Is it weighted? (1 = yes) "))
#This gets the corresponding grade
grade = studentGPA(letterGrade, weight)
#This prints the grade point
print("Your GPA score is: ", grade)
#This calculates the total grade
total += grade
#This calculates the GPA
GPA = total/klass
#This prints the GPA
print("Your weighted GPA is a",GPA)
Read more about for loop at:
https://brainly.com/question/12736327
What does an effect allow you to do in
EarSketch?
Answer:usbebdos did did I’d did d
Explanation:
Bash six ska over five. I did a sis a and
what is main function of processing unit?
Answer:
to control the operation of all part of the computer.
hope it helps.
Answer:
to control the operations of the computer
Explanation:
hope it's help you have a great day keep smiling be happy stay safe ☺
KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
Answer:
Yea it should, it depends are you using a phone or a PC? because most of the time internally built in editing software on computers is better.
I REALLY Need help on this.
how many string object are in 128,55 in python
Answer:
Explanation:
In the following examples, input and output are distinguished by the presence or absence of prompts (>>> and …): to repeat the example, you must type everything after the prompt, when the prompt appears; lines that do not begin with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command.
Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, #, and extend to the end of the physical line. A comment may appear at the start of a line or following whitespace or code, but not within a string literal. A hash character within a string literal is just a hash character. Since comments are to clarify code and are not interpreted by Python, they may be omitted when typing in examples.
There are 4 strings within the best_list. Strings can be easily identified becuase they're surrounded with quotes. For example, "hello" is a string because it has the quotes around it.
Decision support systems help managers use structured data to identify problems and find solutions to business-related problems. The financial management system is an example of this system.
Answer:
sorry about this
Explanation:
please help which one is the right symbol?
Answer:
second one >
hope it helps.
pleasee help meeeeeeeeee I’m stuckk!!!!
Answer: Charles Babbage
Answer:
a
Explanation:
trust
What are a few ways to format the text in a mail message in Outlook? Check all that apply.
Attach a file to the message to be opened separately.
Open the Font dialog box to access more detailed options.
Increase or decrease the indent.
Copy and paste text from a Word document
Use the Mini Toolbar to change the font appearance.
Click the Format Painter to paste a saved font format.
Answer:
The answers are b,c,d,e,f
Explanation: