Question

Write python code on computer, No handwritten code

You will implement a program which asks the user to enter scores of different courses in different semesters. The program should read the input and output some simple statistics 1. An example input string by the user is given below. Fal12016-coursel:82, course2:80,course3:85;Spring2018- course4:82;Fall2018-course5:85, course6:50, course7:78 Info from different semesters are separated by a ;, courses in each semester are separated by a,and score and corresponding course is separated by a, information of each courses is followed by aafter the semester name. Write python program that accept the input string from the user and prints out the following: Average score made by the student in each semester Letter grade for each course for each semester, average GPA for the student in each semester and average GPA for the student across all the semesters. In each semester, print the course (along with the score) in which the student got the highest score. Assume in each semester, the student doesnt get the same score in two courses. · Here, you are encouraged to solve the problem by implementing different functions. The type d are left to your discretion. Letter grade criteria: Letter grade Score criteria 90 -80 and < 90 > 70 and < 80 60 and < 70 < 60

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Course Info.py - D:\Coding PYTHON Course Info.py (3.6.2) File Edit Format Run Options Window Help print (Enter the scores ofelif courseScore> 60: cGradeD gpa totall else: cGrade = F total- total courseScore grade_details grade_details+courseName++

OUTPUT :

RESTART: D:\Coding\ PYTHON Course Info.py Enter the scores of a student for different semesters Fall 2016-coursel: 82, courseCODE:

print('Enter the scores of a student for different semesters')
data = input()
sems = data.split(';')
semisters = list()
averages = list()
grades = list()
gpas = list()
maxScores = list()
for sem in sems:
#print(sem)
names = sem.split('-')
#print(names)
name = names[0]
semisters.append(name)
scores = names[1]
#print(name,' ',scores)
courses = scores.split(',')
#print(courses)
total=0
grade_details = ''
gpa_total = 0
max_score = 0
max_score_course=''
for course in courses:
cinfo = course.split(':')
courseName = cinfo[0]
courseScore = int(cinfo[1])
if courseScore>max_score:
max_score = courseScore
max_score_course = courseName
cGrade = ''
if courseScore>=90:
cGrade = 'A'
gpa_total += 4
elif courseScore>=80:
cGrade = 'B'
gpa_total+=3
elif courseScore>=70:
cGrade = 'C'
gpa_total += 2
elif courseScore>=60:
cGrade = 'D'
gpa_total += 1
else:
cGrade = 'F'
total = total + courseScore
grade_details = grade_details+courseName+' '+cGrade+','
  
avg = total/len(courses)
averages.append(round(avg,2))
gpas.append(round(gpa_total/len(courses),2))
grades.append(grade_details[:-1])
maxScores.append(max_score_course+' '+str(max_score)+' points')

print('Average score made by the student in each semester:')
print('------------------------------------------------------')
for i in range(len(semisters)):
print(semisters[i]+': '+str(averages[i]))

print('\nLetter grade for each course for each semester:')
print('------------------------------------------------------')
for i in range(len(semisters)):
print(semisters[i]+': '+grades[i])

print('\nGPA for the student:')
print('------------------------------------------------------')
for i in range(len(semisters)):
print(semisters[i]+': '+str(gpas[i]))

print('\nMaximum score in each semester:')
print('------------------------------------------------------')
for i in range(len(semisters)):
print(semisters[i]+': '+maxScores[i])

Add a comment
Know the answer?
Add Answer to:
Write python code on computer, No handwritten code You will implement a program which asks the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This question was answered by someone else but their code doesn't work when I try to...

    This question was answered by someone else but their code doesn't work when I try to run it. Q1. Currently, you are enrolled in the Spring semester and taking five courses. Write a program that asks the user to enter the final score of each course. The program should display a letter grade for each class, a statement based on a letter grade, and a spring semester GPA. Each course has 3 credit hours. Write the following functions in the...

  • Implement a C program to calculate the Average Score Point(ASP) of a student taking N courses...

    Implement a C program to calculate the Average Score Point(ASP) of a student taking N courses in a semester. Ask the user for the number of courses(N) the student is taking in the semester, and check if the number of courses is greater than 1 (>1). If the number of courses is less than or equal to 1(<=1), display an error and ask the user to try again until the right input is entered. Next, ask the user for the...

  • Write a program that asks the user to enter five test scores. The program should display...

    Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Score Letter Grade...

  • Program 5 Due 10/25 C-String and Two-dimensional Array Use An input data file starts with a...

    Program 5 Due 10/25 C-String and Two-dimensional Array Use An input data file starts with a student's name (on one line). Then, for each course the student took last semester, the file has 2 data lines. The course name is on the first line. The second line has the student's grade average (0 to 100) and the number of credits for the course Sample data: Jon P. Washington, Jr. Computer Science I 81 4 PreCalculus 75 3 Biology I 88...

  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • In this assignment you are asked to write a python program to maintain the Student enrollment...

    In this assignment you are asked to write a python program to maintain the Student enrollment in to a class and points scored by him in a class. You need to do it by using a List of Tuples What you need to do? 1. You need to repeatedly display this menu to the user 1. Enroll into Class 2. Drop from Class 3. Calculate average of grades for a course 4. View all Students 5. Exit 2. Ask the...

  • Problem Specification: Write a C++ program to calculate student’s GPA for the semester in your class. For each student, the program should accept a student’s name, ID number and the number of courses...

    Problem Specification:Write a C++ program to calculate student’s GPA for the semester in your class. For each student,the program should accept a student’s name, ID number and the number of courses he/she istaking, then for each course the following data is needed the course number a string e.g. BU 101 course credits “an integer” grade received for the course “a character”.The program should display each student’s information and their courses information. It shouldalso display the GPA for the semester. The...

  • Write a grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • Create a program in Python to change Grades in number and find the GPA of the...

    Create a program in Python to change Grades in number and find the GPA of the user Problem: The user wants an easy calculator to calculate their GPA. They want to enter the letter grade (A, B, C, D, F) for 5 classes, the credit hours (1, 2, 3,4, 5) and then run the program to calculate the GPA (3.50- 4.00 A, 3.49 – 2.50 B, 2.49 -1.60 C, 1.59 – .50 D, .49 -0 F) for the semester. Task...

  • Write a c++ program which uses a structure having the indicated member names to store the...

    Write a c++ program which uses a structure having the indicated member names to store the following data: Name (student name) IDnum (student ID number) Tests (an array of three test scores) Average (average test score) Grade (course grade) The program will keep a list of three test scores for one student. The program may prompt the user for the name, ID number, and test scores, or these may be assigned within the program. The average test score will be...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT