Question: Create a Student class with four instance attributes: stu _ number as an int, name as a string, major as a string and GPA as
Create a Student class with four instance attributes: stunumber as an int, name as a string, major as a string and GPA as an float. The class should include an init method to initialize a Student object and a str method to describe an initialized student object. The class should include two instance methods: one called updatemajor which takes a string as an argument and updates the employee's department attribute; and one called updateGPA which takes a float as an argument and updates the Student GPA attribute.
After the Student class code, prompt the user to enter the stunumber, name, major and GPA. Instantiate an Student object by passing in the user's input as the arguments and print out the Student's attributes by calling the str method. No prompting for input should be included in the Student class.
Test the updatemajor and updateGPA methods by calling both methods and passing in a new major and GPA for the Student object that you created. Call the str to display the updated Student object information.
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
