20251108143644.webp
Q

20251108143644.webp

Question paper (build 07.05.20.19)
+getMaker():String
+getPrice(cint
+setPrice(price:int):void
The program output might look something like:
Enter maker: franceCake
Enter price: 12
1. Test getMaker()
2. Test setPrice()
Enter TC (1 or 2): 1
obtained by converting the last character in maker to
uppercase format and the remaining characters in
maker to lowercase format.
getPrice():int-return price.
setPrice(price:int):void-update price.
Do not format the result.
Enter maker: Vietnamcake
Enter price: 12
1. Test getMaker()
2. Test setPrice()
Enter TC (1 or 2): 2
Ok
OUTPUT:
francecakE
Enter new price: 15
OUTPUT:
15
Question 2:
(3 marks) Write a class Coffee and a class SpecCoffee extending from Coffee (i.c. Coffee is a superclass
FUO and SpecCoffee is a subclass) with the following information:
Coffee
Where:
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom