PRO192_-_PE02_-_SU_2024_2181.webp
G

PRO192_-_PE02_-_SU_2024_2181.webp

4 of 5 Paper No: 1
Enter the first edge:3
Enter the second edge:4
Enter the first edge:8 Enter the second edge:8
Enter the third edge:5
Enter the color: Red
Enter the third edge:8 Enter the color:Red
1.Test ValidData
2.Test calPerimeter
1.Test ValidData
3.Test calArea
2. Test calPerimeter
3.Test calArea
Enter your choice(1/2/3):2
Enter your choice(1/2/3):3
OUTPUT:12.00
OUTPUT:27.71
+ 93%
Close
Question 3:
(2 marks)
Write a class named Promotion with the following information:
Promotion
Where:
id: int - name:String
Promotion() - default constructor
- discountPercentage: double
• Promotion(id: int, name: String,discountPercentage: double) -parameterizedconstructor that sets values to the id, name,and the discountPercentage
+Promotion()+Promotion(id:int, name:String,discountPercentage:double)
getters & setters: write the setters and getters of all the fields
+getters & setters
toString(): String - return a string format that
+ toString(): String
contains all the information of the promotion:
id, name, and discount percentage. The discount percentage is formatted to two

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

Thông tin

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

Image metadata

Filename
PRO192_-_PE02_-_SU_2024_2181.webp
File size
169.9 KB
Dimensions
1920px x 859px

Share this media

Back
Bên trên Bottom