Q1_20250829091132.webp
Jellal87

Q1_20250829091132.webp

  • Media owner Jellal87
  • Ngày thêm
Kizspy.me
te a class Apartment (in the default package of the NetBean) with the following information:
-id: int;
- name: String
- price: double
Apartment
-numberOfBedrooms: int
+Apartment()
+Apartment(id: int, name: String, price:
double, numberOfBedrooms: int)
+getName(): String
+getFinal Price (): double
double
+toString(): String
Where:
Apartment() default constructor.
Apartment(id: int, name: String, price: double,
numberOfBedrooms: int) parameterized
constructor, which initializes id, name, price, and
numberOfBedrooms of the Apartment.
⚫ getName(): String - returns the name in uppercase
⚫ getFinalPrice():double return the final price of
the apartment. If numberOfBedrooms >= 2 then
final price will be calculated by increase the price
by 10%.
.toString():String return the string format that
contains all the information of the Apartment:id,
name, numberOfBedrooms, final price. The
apartment name in uppercase, the final price
formatted to two decimal places.
Do not format the result.
The program output might look something like this:
Zoom
+ 100%
Close
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom