Answer computer question
Answers
Answer:
buy this book and start reading!!!
I'm using Python language to accept marks of three subjects from the user and to print its total average and grade.
Python is a powerful high-level, object-oriented programming language. It was created by Guido van Rossum and launched in 1991. It works on different platforms like Raspberry Pi, Linux, Mac, Windows and many more platforms.
The Program
sub1 = int(input("Enter first subject marks: "))
sub2 = int(input("Enter second subject marks: "))
sub3 = int(input("Enter third subject marks: "))
avg = sub1 + sub2 + sub3/3
if avg >= 90:
print("Your average is:", round(avg,2), "Your grade is: A", sep="\n")
elif avg >= 80:
print("Your average is:", round(avg,2), "Your grade is: B", sep="\n")
elif avg >= 70:
print("Your average is:", round(avg,2), "Your grade is: C", sep="\n")
elif avg >= 80:
print("Your average is:", round(avg,2), "Your grade is: D", sep="\n")
Program Explanation
We've taken three user inputs to accept the marks of the respective subjects and stored them in different variables.
After that, we've found the average of the marks, by using the average formula.
And finally, we've used an else condition to decide the grade based on the average of the marks. And our Python program is finished and ready to run.