Problem: Write a Python program that reads from an input file given by a user students information after a summer semester which allow students to take two courses. The program will calculate the accumulated semester grade point average (GPA) according to the courses grades and the number of credit hours of the courses. The GPA scores are shown in table 1. The accumulate GPA is calculated as the following equation GPAcourse 1 • Creditscourse 1 + GPAcourse 2 Credits.course 2 A Creditscourse1+ Creditscourse 2 Accumulate GPA = The input file contains student id and student name in the first line. The rest lines contain courses information (course code, course credit hours, student grade). Suppose the input files always in the same format as in the given sample inputs in Figures 2 and 3. The program should display the result in an output file with name "result_ID.txt" where ID is the student Id. Your output files should be in the same format as shown in the given sample outputs in Figures 2 and 3. The first line contains student name and id followed by a table of courses information and at the end the accumulated GPA. Figure I shows a sample run on a console window. Table 1 GPA Scores Grade A GPA 4.0 B 3.0 2.0 D 1.0 F 0.0 Enter the file name of a students: st 15577.txt The output file named 'result 15577.txt'has been successfully created. Figure 1 Console window 215577 t Notepad File Edit Format View Help 15577ar Mohammed Al zidi ENGEe:3:0 MATHI01:3:D resut 15577 tt- Notepad Fle Edit Format View Help student ID: 15577 Student Nane: Anar ohammed Al zidi Course Code ENGE370 MATHI01 Credits Grade Total Attempted: 6 CUM GPA: 1.50 Figure 2 Samplel input file (left) and output file (right) a4.2410t File Edit Format View Help 23410 Maryan Abdullah Al Ari student ID: 23410 student Nane: Maryan Abdullah Al Ari MATH2202:3 ARAB1100:2IA result 23410.bt- Notepad Fle Edit Format View Help Course Code Credits Grade MATH2202 ARAB1100 Total Attempted: s CUn GPA: 3.40 Figure Sample2 input file (left) and output file (right)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Problem:
Write a Python program that reads from an input file given by a user students information after a summer
semester which allow students to take two courses. The program will calculate the accumulated semester
grade point average (GPA) according to the courses grades and the number of credit hours of the courses.
The GPA scores are shown in table 1. The accumulate GPA is calculated as the following equation
GPAcourse 1 Creditscourse 1 + GPAcourse 2 • Credits.course 2
A Credits.course 1 + Creditscourse 2
Accumulate GPA =
The input file contains student id and student name in the first line. The rest lines contain courses
information (course code, course credit hours, student grade). Suppose the input files always in the same
format as in the given sample inputs in Figures 2 and 3.
The program should display the result in an output file with name "result ID.txt" where ID is the student
Id. Your output files should be in the same format as shown in the given sample outputs in Figures 2 and
3. The first line contains student name and id followed by a table of courses information and at the end the
accumulated GPA.
Figure I shows a sample run on a console window.
Table 1 GPA scores
Grade
A GPA
4.0
3.0
2.0
D
1.0
F
0.0
Enter the file name of a students: st 15577.txt
The output file named 'result 15577.txt has been successfully created.
Figure 1 Console window
st15577 tt-Notepad
result 15577.tt - Notepad
File Edit Format View Help
15577ar Mohammed Al zidi
ENGESe:3:C
MATHI301:3:D
File Edit Format View Help
Student ID: 15577
ww *
Student Name: Amar Mohammed Al zidi
Course Code
ENGE3780
Credits
Grade
3.
MATHI301
Total Attempted: 6
CUM GPA: 1.5e
Figure
Samplel input file (left) and output file (right)
result 23410.txt - Notepad
st 23410 bt
File Edit Format View Help
23410:Maryan Abdullah Al Amri
MATH2202:3:8
ARAB1100:2:A
File Edit Format View Help
student ID: 23410
Student Name: Maryan Abdullah Al Amri
Course Code
Credits
Grade
MATH2202
ARAB1100
Total Attempted: 5
CUM GPA: 3.40
Figure 3 Sampl@2 input file (left) and output file (right)
Transcribed Image Text:Problem: Write a Python program that reads from an input file given by a user students information after a summer semester which allow students to take two courses. The program will calculate the accumulated semester grade point average (GPA) according to the courses grades and the number of credit hours of the courses. The GPA scores are shown in table 1. The accumulate GPA is calculated as the following equation GPAcourse 1 Creditscourse 1 + GPAcourse 2 • Credits.course 2 A Credits.course 1 + Creditscourse 2 Accumulate GPA = The input file contains student id and student name in the first line. The rest lines contain courses information (course code, course credit hours, student grade). Suppose the input files always in the same format as in the given sample inputs in Figures 2 and 3. The program should display the result in an output file with name "result ID.txt" where ID is the student Id. Your output files should be in the same format as shown in the given sample outputs in Figures 2 and 3. The first line contains student name and id followed by a table of courses information and at the end the accumulated GPA. Figure I shows a sample run on a console window. Table 1 GPA scores Grade A GPA 4.0 3.0 2.0 D 1.0 F 0.0 Enter the file name of a students: st 15577.txt The output file named 'result 15577.txt has been successfully created. Figure 1 Console window st15577 tt-Notepad result 15577.tt - Notepad File Edit Format View Help 15577ar Mohammed Al zidi ENGESe:3:C MATHI301:3:D File Edit Format View Help Student ID: 15577 ww * Student Name: Amar Mohammed Al zidi Course Code ENGE3780 Credits Grade 3. MATHI301 Total Attempted: 6 CUM GPA: 1.5e Figure Samplel input file (left) and output file (right) result 23410.txt - Notepad st 23410 bt File Edit Format View Help 23410:Maryan Abdullah Al Amri MATH2202:3:8 ARAB1100:2:A File Edit Format View Help student ID: 23410 Student Name: Maryan Abdullah Al Amri Course Code Credits Grade MATH2202 ARAB1100 Total Attempted: 5 CUM GPA: 3.40 Figure 3 Sampl@2 input file (left) and output file (right)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education