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
  • Write a C++ program to implement this task. Students are registered in 3 courses in a...

    Write a C++ program to implement this task. Students are registered in 3 courses in a semester. To pass each course, students have to make a grade greater than or equal to 40. You have to write a program to determine if the student will pass or fail the semester, based on the following criteria: A student passes if all three courses are passed. Additionally, a student may pass if only one subject is failed, and the overall average grade...

  • 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...

  • Write a program that will calculate your letter grade at the end of the semester for...

    Write a program that will calculate your letter grade at the end of the semester for CSIS130. Your program will read an input file that shall contain all the tests scores and lab scores for the semester, and the input file data should be in the following format: full name of student Test1 Score (0…100), Test2 Score (0..100) , Final Exam Score (0..100), Total Number of Labs: N NLab Scores (0=Fail, 1=Pass) [You will have N lab scores each separated...

  • In Python In this programming assignment, you will do multiple programming exercises, and eventually develop a...

    In Python In this programming assignment, you will do multiple programming exercises, and eventually develop a Python application that can calculate student course grades. (6 points) Write a program called p2-1.py to: (1) create a list and add integer numbers from 1 to 100 to the list; (2) calculate the average value of all numbers in the list; and (3) print the result (screenshots). (8 points) Write a program called p2-2.py to: (1) allow a user to define how many...

  • 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...

  • I've built a C++ program that calculates the user's class average based on three test. Can...

    I've built a C++ program that calculates the user's class average based on three test. Can somebody show me how to get the program to look for invalid input? #include <iostream> #include <string> #include <iomanip> using namespace std; int main() { //variables int score_1; //test 1 input from user int score_2; //test 2 input from user int score_3; //test 3 input from user int highest; // the higher score of test 1 & 2 int course_average; //average for class //Introduce...

  • 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...

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