Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programmer defined objects Modify the studentRecord object as indicated below. h. Change the name property to fname and assign a first name of your choosing
Programmer defined objects Modify the studentRecord object as indicated below. h. Change the name property to fname and assign a first name of your choosing 2. Add an Iname property and assign a last name of your choosing 3. Set the major property to a major of your choosing 4. Add a gpa property and set it to zero 5. Modify the displayStudentRecord method to print all of the studentRecord properties in the following order: fname, Iname, major, gpa 6. Add an else clause to the if statement in the setMajor method that displays an error message if a new major value was not passed in. 7. Add a setGPA method that has one parameter called newGPA. Set the student gpa property equal to the newGPA parameter. Make sure to verify that a new gpa value was passed in. If a new gpa value was not passed in display an error message. The setGPA method is similar to the setMajor method
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