Question: make a program using these steps 1. Driver Application Program Filename is based on your last-name and P2 For example LASTNAMEfirstInitial_P2.java (make sure to replace
1. Driver Application Program Filename is based on your last-name and P2 For example LASTNAMEfirstInitial_P2.java (make sure to replace LASTNAME with yours) And the class definition is save as LASTNAMEfirstinital_Student.java ## at the beginning of both files - put your name, student ID, location where this assignment has been completed, and a brief description about this file as a comment ## Zip both files together and name it LastnameFirstInitial P2.zip and submit on Blackboard The LASTNAMEfirstInitial_Student class - Based on UML class diagram given 2. Attributes - name, appropriate access modifier and data types (see UML) 3. Constructor -- A constructor to initialize a LASTNAMEfirstInitial_Student object's attributes only with parameters 4. Accessor methods -- will retrieve the object's attributes: getName, get Major, checkClassification, and getGPA 5. Mutator methods will assign the new value to object's attributes (Note that some method may not prefix with set): setName, switch Major, updateClassification and changeGPA 6. calculateGPA will read in 6 numbers, each represent a grade weight [Ex. 3.7 for A-, 3.0 for 3, etc.). The first 3 grades are for 3 credit-hour courses, the 4th grade is for 4-credit MAT course the 5" grade is for 2-credit HEA course, and last one for 1-credt UNI 101 course. Make sure the gpa result in only 2 decimal point. Note that no round up, just round at 2 decimal point 7.toString method that will return a string that is a concatenation of the object's name, major, classification, and gpa using TAB as a delimiter between each value (look up in the book index to show how toString method should be defined) The Driver Program - Lastname FirstInit_P2.java (XXX is your initials, first-middle-last initials) 8. Create a Driver class that should do the following tasks a. Create all necessary objects and variables with appropriate data types b. Read LASTNAMEfirstInitial_Student information from the keyboard using Scanner class: name, major, classification, gpa. Prompt the user appropriately (see sample 1/0) c. Create a LASTNAMEfirstInitial Student object called firstStudent_XXX. Pass in appropriate variables i. Set this student's GPA using the appropriate mutator method ii. Print out the state of this object (all attributes, see sample 1/0) d. Create a second LASTNAMEfirstInitial_Student object, called secondStudent_XXX Hard code the appropriate parameters - using your own information i. Prompt the user and Read in from the keyboard 6 grades (see sample 10) ii. Calculate GPA ii. Print the current state of the object iv. Prompt the user and Read in from the keyboard a new major (see sample 1/0) V. Switch the major vi. Print out the update state of the object ** Make sure to format your output screen nice and meat, see sample ** Comments should be put throughout the program to explain what is being done or computed: and programming style for readability 10. Delivery - a Source code (java files - 2 files: class and driver application as well as screenshot(s) of your output - submitted on Blackboard on due date by 11:59pm -- zip both files -- LastnameFirstInitial P2.zip Sample Output / don't have to be exact, but need to be nice and neat ----GRASP exec: java Hackeri_P2 Welcome to YOUR FULL NAME - Spring 2021 Enter your friend's name: Peter Johnson Enter your friend's major: CSC Enter your friend's classification: Freshman ** Test the program using these Enter your friend's GPA: 3.6 values in BOLD ORANGE (except parts that you have to enter Student 1 Information: Name: Peter Johnson your information) ** Major: CSC Classification: Freshman GPA: 3.6 Enter grades for Student 2 (A -> 4.0, A--> 3.7): ENG 101 (3 cr.): 3.3 CSC 152 (3 er.): 3.7 Notice that each of these courses may have different credit CSC 120 (3 cr.): 3 hours. You may choose different courses, but make sure MAT 151 (4 r.): the first 3 courses have 3 credit hours, and 4 one is 4 HEA 200 (2 cr.): 3 PE 101 (1 r.): 3 credit, and the 5th course has 2 credits and last with I credit. Student 2 Information: Make sure that these are different Name: Henry Harrison Major: Business to demonstrate that the classification: Sophomore switch Major method works GPA: 3.43 Enter Henry Harrison's new major: CIS LASTNAMEfirstInitial_Student Student 2 Updated Information: Name: Henry Harrison name : String Major: CIS major : String Classification: Sophomore classification : String GPA: 3.43 spa : double ----JGRASP: operation complete. + Student Calam : String, aajor : String, aclass : String) UML Diagram for Student Class - getkame(): String + getajor > String checkclassificationString Please make sure that you ask question getGPA (double and clarify any ambiguous sesame (rew Name : String): void + switch or (newajor : String); void requirement!!!! updateclassification newclass : String): void changeGPA (newGPA double) : void calculateGPA (gradel : double, grade2: double, GPA calculation is based on the grade grade3 double, grade 4 double, grade5 : double, grade 6 double) : void points and credit hours for each course toStringtString https://gpacalculator.net/how-to-calculate-gpal LASTNAMEfirstInitial Student name : String major : String classification : String gpa : double + Student (aName : String, aMajor : String, aClass : String) + getName(): String + getMajor () : String + checkClassification (): String + getGPA () : double + setName (newName : String): void + switchMajor (newMajor : String) : void + updateClassification ( newclass : String ) : void + changeGPA (newGPA : double) : void + calculateGPA (gradel : double, grade2 : double, grade3 : double, grade4 : double, grade 5 : double, grade 6 : double) : void + toString(): String
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
