PRO192_-_PE02_-_SP_2025_3836.webp
Q

PRO192_-_PE02_-_SP_2025_3836.webp

☑Kizspy.me
-gpa: int
+ Student(id:String, name:String,
email:String, gpa:int)
+getGpa():int
+setGpa(gpa:int):void
+getReward ():double
+toString():String
Student(id:String, name:String, email:String,
gpa:int)-parameterized constructor, which
sets values to id, name, email, and gpa. If
the gpa is less than 0 or greater than 100 then
set it to 0
⚫ getGpa():int-return the gpa
⚫ setGpa(gpa:int):void-update the gpa. If the
gpa is less than 0 or greater than 100 then set
it to 0
⚫ getReward (): double-return the reward
(default reward is 0) calculated according to
the following formula:
-If 70 gpa <80 then reward is 7000 * P
-If 80 gpa <90 then reward is 8000* P
-If 90 gpa <100 then reward is 9000 * P
with P-gpa/100, for example: if gpa is 80
then P 80/100=0.8
⚫ toString(): String - return a string format that
contains all the information of the student: id,
name, email, reward. The name is in
uppercase format and the reward is formatted
to two decimal places.
Zoom
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
Quốc Khánh1
Ngày thêm
Lượt xem
7,791
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom