-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeesCal.java
More file actions
34 lines (30 loc) · 1.11 KB
/
FeesCal.java
File metadata and controls
34 lines (30 loc) · 1.11 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
import java.util.Scanner;
public class FeesCal {
double min = 10000.00;
double total = 0.00;
//Original >=50000
//if deposit >=original/2 then 5% discount
//total = school levy + sports fee; school levy = 10% of original, sports fee = 5% of original
//Cal total
//Program must request user to enter fees >50,000, also enter amount to deposit
double original;
double deposit;
FeesCal(){
Scanner s = new Scanner(System.in);
System.out.println("Enter original fees to deposit i.e. > Rs.50,000 ::");
original =s.nextDouble();
deposit =s.nextDouble();
}
public static void main(String[] args) {
FeesCal obj = new FeesCal();
obj.total = obj.original;
if (obj.deposit >= obj.original/2){
obj.total -= obj.total*(double)1/20;
}
double school_levy = obj.original*(double)1/10;
double sports_fee = obj.original*(double)1/20;
obj.total += school_levy + sports_fee;
System.out.print("Total fees to deposit :: ");
System.out.print(obj.total);
}
}