-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResort.java
More file actions
41 lines (36 loc) · 1.06 KB
/
Copy pathResort.java
File metadata and controls
41 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner;
class Resort {
int RNo, Days;
String Name;
float Charges, Amount;
void Getinfo() {
Scanner sc = new Scanner(System.in);
System.out.print("Enter Room No: ");
RNo = sc.nextInt();
System.out.print("Enter Name: ");
Name = sc.next();
System.out.print("Enter Charges per day: ");
Charges = sc.nextFloat();
System.out.print("Enter Days: ");
Days = sc.nextInt();
}
float Compute() {
Amount = Days * Charges;
if (Amount > 11000)
Amount = 1.02f * Amount;
return Amount;
}
void DispInfo() {
Compute();
System.out.println("Room No: " + RNo);
System.out.println("Name: " + Name);
System.out.println("Charges: " + Charges);
System.out.println("Days: " + Days);
System.out.println("Amount: " + Amount);
}
public static void main(String[] args) {
Resort r = new Resort();
r.Getinfo();
r.DispInfo();
}
}