Fundamentals of Computability
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.
5 years ago
2
Answer(0)
other Questions(10)
- accounting
- SPSS / T- test
- philo exam
- need help with my chemistry quiz chem 101
- Utilitarians argue that consequences are the primary basis for evaluating the morality of actions, are certain actions inherently wrong, regardless...
- Ecalder
- Assignment 2: Controls
- due sunday
- Case essay question for SUPERBEE
- analysis ad