+getPass(): String
+setName(lastname:String)
+toString():String
The program output might look something like:
Enter name: hoa
Enter gpa: 5.4
1. Test setName()
2. Test getPass()
Enter TC (1 or 2): 1
Enter lastname: nguyen
OUTPUT:
hoa nguyen, 5.4
•
•
otherwise return "Tall.
setName(lastname:String) - return the name with
the first letter in uppercase.
toString())-return String with format name, gpa
Do not format the result.
Enter name: lan
Enter gpa: 4.5
1. Test setName()
2. Test getPass()
Enter TC (1 or 2): 2
OUTPUT:
fail
Question 2:
(3 marks) Write a class Car and a class SpecCar extending from Car (i.e. Car is a superclass and
SpecCar is a subclass) with the following information:
-color:String
-seat:int
Car
Where:
getColor():String - return color.
getSeat():int-return Seat.
Zoom
- FUO
+ 100%
Close