PRO192_-_PE_-_SP_2024_1494.webp
O

PRO192_-_PE_-_SP_2024_1494.webp

  • Media owner Obanai89
  • Ngày thêm
Question 2:
(3 marks) Write a class Wall and a class SpecWall extending from Wall (i.e. Wall is a superclass and SpecWall is a subclass) with the following information:
Wall
Where:
2 of 2 Paper No: 7
-place:String
-area:int
getPlace():String - return place.
getArea():int-return area.
+Wall()
setPlace(place:String):void - update place.
+Wall(place:String, area:int)
+getPlace():String
toString():String-return the string of format:place, area
+getArea():int
+setPlace(place:String):void
+toString():String
Where:
SpecWall
toString():String return the string of format:
-color:String
place, color, area
+SpecWall()
+SpecWall(place:String, area:int, color:String)
setData():void Remove the place characters that are not the alphabets.
+toString():String
+setData():void+getValue():String
getValue():String - Check if the area not divisible by the length of the place then return color, otherwise return color+x (x is the result of dividing the area by
+ 95%
Zoom

Close
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
PRO192_-_PE_-_SP_2024_1494.webp
File size
194.2 KB
Dimensions
1920px x 990px

Share this media

Back
Bên trên Bottom