-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathb_execMethodsCarpets.java
More file actions
38 lines (31 loc) · 1.26 KB
/
Copy pathb_execMethodsCarpets.java
File metadata and controls
38 lines (31 loc) · 1.26 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
package g_oo;
/*
*/
public class b_execMethodsCarpets {
public static void main(String[] args) { // run class or execute class
double length = 2.0, width = 4.00;
double p = 0.0, lc = 0.0, tf =0.0;
double fullPrice = 0.0;
// create an object or instantiate the class or create an instance
//cannot instantiate an abstract class
//vatUK im = new vatUK(); //constructor runs here
//vatGermanay im = new vatGermanay(2.50); // labourprice = 2.50
b_finalCarpats im = new b_finalCarpats(1.14, 22.00, 15);
// provide value to the input parameter of the constructor
double area = im.calcArea(length, width); // length * width
p = im.calcPrice(area);
lc = im.calcLabourCost(area);
tf = im.calcTravelFee(12);
fullPrice = p + lc + tf;
System.out.println("Carpet Price " + (p ));
System.out.println("Labour Price " + lc );
System.out.println("Travel Fee " + tf );
System.out.println("Full Price " + (fullPrice) );
double vat = im.addVat(fullPrice);
System.out.println("Price with VAT: " + vat);
double bonus = im.bonus(vat);
System.out.println("Price Plus Bonus" + bonus);
//double pVat = im.calcVat(fullPrice); //inchild
//System.out.println("Price with VAT: " + pVat);
}
}