Question
Using python to program the folowwing problem. A student object consists of: FirstName: string LastName: string Birthdate: tuple with (month, day, year), such as (1,17,1998)
Using python to program the folowwing problem.
A student object consists of:
FirstName: string
LastName: string
Birthdate: tuple with (month, day, year), such as (1,17,1998)
TechID: string
Grades: list of tuples (each tuple will have a 4-digit course ID, course grade, and number of credits) such as [(3127,C,4),(2496,B,3),(6703,D,3)]
So one student might look like this:
FirstName: Bob
LastName: Smith
Birthdate: (2,17,1998)
TechID: 43546578
Grades: [(5930,B,4),(7660,C,4),(3122,C,3),(5438,C,2),
(6730,C,4),(4268,C,4),(5709,D,4),(8071,B,4)]
Create a list of students. The data for each student can be found in the text files.
Your program should read the data from each of the files, as appropriate. (Do not change the format of the input files.)
Create three methods for a student object:
currentAge: How old is the student? Be sure to use the Python module. Be sure that you do not just subtract the birth year from the current year.
Hint:
import datetime
now = datetime.datetime.now()
print (now.year)
currentGPA: What is the students GPA?
Report: Add the output for that student to the output file.
Each output file item should look like this, for the above student:
Bob Smith (#43546578)
Age: 18 (02/17/1998)
GPA: 2.14 (29 credits)
We use two input files fir is formatted as follows:
87965164,Paris,Yu,6/27/1997 87965219,Heath,Moss,10/13/1996
The number at the beginning is a techID and you use it to find the classes taken by the student from the second input file:
87965219,5569A4 87965158,5668D3
After the techID it is the class number, the grade and the credits its worth.
Finally we write the output listed above to an output file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started