Consider the following class: class Student { private String name ; ?? public void setName ( String n) { ???????
Consider the following class:
class Student {
private String name ;
public void setName ( String n) {
name = n; }
public String getName () {
return name ; }
public Student ( String n) {
setName (n); }
}
(a) ( 8 marks ) Extend class Student to class ResearchStudent by adding a data member gpa (standing for grade point average). Marks will be awarded based on correctness of class header, data member and type, getter and setter and parameterized constructor using super keyword.
(b) (2 marks) Declare a Student object referenced be myStudent and use run-time polymorphism with ResearchStudent whose name is "Robin", gpa is 3.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.