In: Computer Science
write an algorithm and python program using the following information. also can y
How much should I study outside of class?
Issue:
Your fellow students need help. This is their first year in college and they need to determine how many hours they need to study to get good grades.
Study Hours Per Week Per Class Grade
15 A
12 B
9 C
6 D
0 F
Project Specifications:
Name: FirstName LastName
Credits: 12
Study Hours: 60
Grade: A
Total Students: 3
Average Credits: 9
Average Study Hours: 20
ou please run the program?
Answer: Hey!! Kindly find your solution here. If you have any queries, feel free to ask me. Thanks.
In this program study hours calculated according to grade and multiply to 4 classes. Suppose a student assume grade A, study hours should be 15 and total hours = 15*4. If you want calculation change just commen me . I'll update the program. Just check average also and tell me.
studentsName = [""] * (10)
grade = [""] * (10)
credits = [0] * (10)
hours = [0] * (10)
sum_hours = 0
creditSum = 0
avgHours = 0
for i in range(1, 2 + 1, 1):
print("Enter student's name")
studentsName[i] = input()
print("enter credits")
credits[i] = int(input())
creditSum = credits[i] + creditSum
print("enter grade")
grade[i] = input()
if grade[i]=="A":
hours[i] = 15*4
sum_hours = sum_hours+hours[i]
elif grade[i]=="B":
hours[i] = 12*4
sum_hours = sum_hours+hours[i]
creditSum = float(creditSum) / 4
for i in range(1, 2 + 1, 1):
print("Student Name:" +studentsName[i])
print("Credits:" +str(credits[i]))
print("Grade:" +grade[i])
print("Study Hours:" +str(hours[i]))
print("Total Students:" + str(i))
print("Average Credits:" + str(creditSum))
print("Average Study Hours:" + str(sum_hours/4))