Discover new information and get your questions answered with IDNLearn.com. Ask any question and receive timely, accurate responses from our dedicated community of experts.
Sagot :
Answer:
In Python
def getpointValue(subject):
if subject >= 75: point = 4; grade = 'A'
elif subject >= 60: point = 3; grade ='B'
elif point >= 50: point = 2; grade = 'C'
elif point >= 40: point = 1; grade = 'D'
else: point = 0; grade = 'F'
return point,grade
subjects= ["Accounting","Marketing","Economics","MIS"]
acct = int(input(subjects[0]+": "))
mkt = int(input(subjects[1]+": "))
eco = int(input(subjects[2]+": "))
mis = int(input(subjects[3]+": "))
acctgrade = getpointValue(acct)
print(subjects[0]+" Grade: "+str(acctgrade[1]))
mktgrade = getpointValue(mkt)
print(subjects[1]+" Grade: "+str(mktgrade[1]))
ecograde = getpointValue(eco)
print(subjects[2]+" Grade: "+str(ecograde[1]))
misgrade = getpointValue(mis)
print(subjects[3]+" Grade: "+str(misgrade[1]))
totalpoint = (acctgrade[0] + mktgrade[0] + ecograde[0] + misgrade[0]) * 3
gpa = totalpoint/12
print("GPA: "+str(gpa))
Explanation:
The solution I provided uses a function to return the letter grade and the point of each subject
I've added the explanation as an attachment where I used comment to explain difficult lines
We greatly appreciate every question and answer you provide. Keep engaging and finding the best solutions. This community is the perfect place to learn and grow together. Discover insightful answers at IDNLearn.com. We appreciate your visit and look forward to assisting you again.