Q1_20251109103343.webp
May76

Q1_20251109103343.webp

  • Media owner May76
  • Ngày thêm
+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
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
May76
Ngày thêm
Lượt xem
2,904
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom