Assignment
University
American Baptist CollegeCourse
CSCI 1534 | Data Analysis and VisualizationPages
2
Academic year
2023
Muthia Marhamah
Views
0
Answer this question. Make a program in python to give a grade to student’s score Source Code : nrp = int(input('Input NRP : ')) daily_score1 = int(input('Input Daily score 1 : ')) daily_score2 = int(input('Input Daily score 2 : ')) daily_score3 = int(input('Input Daily score 3 : ')) midterm = int(input('Input Midterm score : ')) finalexam = int(input('Input Final score : ')) daily_total = (daily_score1 + daily_score2 + daily_score3) / 3 final_score = (0.3 * daily_total) + (0.3 * midterm) + (0.4 * finalexam) grade = final_score if final_score >= 80 : grade = 'A' elif (final_score >= 75 ) and (final_score < 79): grade = 'B+' elif (final_score >= 70 ) and (final_score < 74) : grade = 'B' elif (final_score >= 65) and (final_score < 69) :
grade = 'C+' elif (final_score >= 60) and (final_score < 64) : grade = 'C' elif (final_score >= 55) and (final_score < 59) : grade = 'D' print('Final score : ', final_score) print('Student with NRP', nrp, 'got final score', final_score, 'with a grade', grade) The output :
Python Practice #2 (Give a grade to student’s score)
Please or to post comments