Question: 6. Fill in code in the following given skeleton, assuming a class Student is defined. (10%) class CUHKStudent extends Student { protected static int nextSID

6. Fill in code in the following given skeleton, assuming a class Student is defined. (10%) class CUHKStudent extends Student \{ protected static int nextSID =1157654321; protected int SID; public CUHKStudent ( String name) \{ // Initialize name with some proper student constructor // Assign this SID with nextSID and Update nextSID by adding 7 \} // end of constructor @override protected double getMaxAttainablegPA( ) 1 // 1\% // Override inherited method, tell people it's four for cuHkstudent \} // end of method public void demBeatWithFriends (Student[] friends) f //4\% // on any Exception in this method, return immediately // invoke demBeat() method of all Student friends AND this student ] // end of method public void creditTransferToCUHK ( Student record ) { // 2\% // get returned value of int getCredit() from given Student record // send it to boolean addCredit( int noofCredits ) of this object \}// end of method // end of class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
