Q1_20251126125813.webp
N

Q1_20251126125813.webp

1.
2.
int calculateTicketPrice(int age, char seatType, char customerType) {
int basePrice;
3.
int extraFee;
4.
5.
if (age <6) {
6.
basePrice 30000;
7.
}else if (age <= 17) {
8.
basePrice 50000;
9.
} else if (age <= 64) {
10.
basePrice 70000;
11.
} else {
12.
basePrice = 40000;
13.
}
14.
15.
switch (seatType) {
16.
case 'T':
17.
extraFee 0;
// Regular seat
18.
break;
19.
case 'V':
20.
21.
extraFee = 20000; // VIP seat
break;
22.
case 'D':
23.
24.
25.
26.
extraFee 300ee; // Couple seat
break;
default:
return -1; // Invalid seat type
27.
}
28.
29.
int totalPrice basePrice + extraFee;
30.
Zoom
- FUO
+ 100%
Close
Chưa có bình luận nào.

Thông tin

Category
SWT301
Thêm bởi
Ngọc Huyền
Ngày thêm
Lượt xem
6,248
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom