Question: We are going to solve this by making a new helper class that describes an Assignment: Assignment An assignment tracks the following data: * A
We are going to solve this by making a new helper class that describes an Assignment:
Assignment
An assignment tracks the following data:
A number of points earned.
A number of points possible.
Text representing an assignment category
When an assignment is constructed:
The assignment object receives values for each of its three pieces of information and saves them to its attributes.
Someone using an Assignment object should be able to get but NOT set the number of points earned, points possible, and category from an Assignment.
Using this assignment will require a revision to our Transcript
Transcript
A transcript tracks the following data:
A course name.
A student name.
A year the course was taken.
A semester the course was taken either "Spring" or "Fall"
A group of Assignment objects
A number of assignments recorded
When a transcript is constructed:
The transcript will receive a course name, student name, year, and semester as function parameters.
These parameters will be saved into the proper attributes of the transcript.
Transcript will then save itself an empty group of Assignments that can hold up to twenty assignments.
Transcript's "number of assignments recorded" will be set to appropriately represent the empty group.
When a user wants to record a lab:
The transcript will receive the number of points scored on the lab.
Transcript will then construct a new assignment using that received score, worth possible points and having the category "lab".
This assignment will get stored in the first empty slot of the transcript's group of recorded assignments.
Transcript's number of assignments recorded will increment by one to describe the new 'first empty slot'.
When a user wants to record an exam:
The transcript will receive the number of points scored on the exam.
Transcript will follow the same rules as for a lab, except exams are worth possible points and having the category "exam".
When a user wants to calculate the course grade:
The transcript needs no additional information.
Transcript will create four variables to separately store the total received and possible points on labs and exams, respectively.
For each assignment transcript has recorded:
If the assignment is a "lab", then add the possible and received points to the possible and received lab totals.
Otherwise if the assignment is an "exam", add the possible and received points to the possible and received exam totals.
If no assignment was saved to this 'slot' do nothing!
Note: you should think about what order these different 'branches' of behavior need to be checked in
Once all assignments have been totalled, calculate the weighted average labs are worth of the grade, exams are worth a combined
Calculating the course grade returns a summative course grade as a decimal value.
Transcript should have a private helper method that can convert a numeric grade to a letter:
Given a numeric grade:
if the grade is above... the user receives:
A
A
B
and so on
This method will return the letter grade for the course.
When a user wants to convert a transcript to a String:
Transcript overrides the toString function with its standard signature.
It then saves a string that holds information about the transcript's course, the related student, the received grades, and the final average.
Also display the letter grade for the course after the course average eg A
This textual representation of the Transcript is returned at the end of the method not immediately printed here.
Once you have created the new versions of Assignment and Transcript, also update your main method to use these new versions:
The Main class will have a single static method: main
Main will receive an arbitrary number of string arguments from the command line, representing the student name, course details, some number of labs, and then two exam grades.
As an example: java Main "John Doe" CS "Spring"
Would run the program for a student named John Doe taking CS who performed well on most assignments.
Main will construct an empty Transcript using the biographical student information.
For each command line argument argument starting from the first score argument until two arguments before the end:
Main will convert that argument to a number, then tell its transcript to record that number as a lab score.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
