Question
For this project, createe a Class file called Question1_######## (where########is your student ID) as part of your Quiz project- this file will be your main
For this project, createe a Class file calledQuestion1_########(where########is your student ID) as part of your Quiz project-this file will be your main program. Createe another Class file calledStudentResult- this file will contain the class definition as described in the question below.
Writee a Java class namedStudentResult. This class is the generalised description of a University StudentResult in a subject. TheStudentResultclassmusthave the following data fields: Student ID (eg 90713040), Subject ID (eg, COMP2015), Assessment 1 mark, Assessment 2 mark, Assessment 3 mark, Assessment 4 mark, Total Mark, Grade. This classmusthave a constructor which will take values for Student ID and Subject ID as arguments - no other arguments are allowed for the constructor. The classmayneed 'setter' (mutator) methods for the data fields. The classmayneed 'getter" (accessor) methods for the data fields. The classmustbe able to calculate the Total Mark of all four assessment marks. The classmustbe able to determine the Grade for the subject based upon the Total Mark (a total less than 50 is a Fail, a total greater than or equal to 50 but less than 65 is a Pass, a total greater than or equal to 65 but less than 85 is a Credit, 85 and above is a Distinction). The class must have atoStringmethod that produces a string that includes the Student ID, Subject ID, Total mark and Grade for the object. Otherappropriatemethodsmayalso be necessary as part of your solution.
Writee a Java program that obtains the Subject ID and number of students in the subject, then for each student in the subject
- instantiate a StudentResult object using the constructor described above (the program will need to obtain the Student ID from thekeyboardbefore the object is instantiated),
- afterinstantiating the StudentResult object for the student, obtain the marks achieved for each of the four assessment items (note: each assessment markmustfall in the range 0 to 25) and store the values in the object created,
- based upon thetotalof the marks stored in the StudentResult object, determine the grade,
- store the StudentResult object in an Array or ArrayList
To demonstrate that your StudentResult objects contain correct data field values, use thetoStringmethod mentioned above to write theStudent ID,Subject ID, Total markandGradeto the screen in a suitably readable format for each StudentResult object that is in the Array or ArrayList.
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