SHOW:
|
|
- or go back to the newest paste.
| 1 | package Model; | |
| 2 | ||
| 3 | public class model {
| |
| 4 | ||
| 5 | public double kilowatt; | |
| 6 | public double basicCharge; | |
| 7 | public double excessCharge; | |
| 8 | public double vat; | |
| 9 | public double total; | |
| 10 | public static int consumerCount; | |
| 11 | public static int consumerCount2; | |
| 12 | ||
| 13 | public model(double kilowatt2, double basicCharge2, double excessCharge2, double vat2, double total2) {
| |
| 14 | // TODO Auto-generated constructor stub | |
| 15 | ||
| 16 | this.kilowatt = kilowatt2; | |
| 17 | this.basicCharge = basicCharge2; | |
| 18 | this.excessCharge = excessCharge2; | |
| 19 | this.vat = vat2; | |
| 20 | this.total = total2; | |
| 21 | } | |
| 22 | ||
| 23 | public void model(double kilowatt, double basicCharge, double excessCharge, double vat, double total) {
| |
| 24 | ||
| 25 | this.kilowatt = kilowatt; | |
| 26 | this.basicCharge = basicCharge; | |
| 27 | this.excessCharge = excessCharge; | |
| 28 | this.vat = vat; | |
| 29 | this.total = total; | |
| 30 | ||
| 31 | } | |
| 32 | ||
| 33 | public void print() | |
| 34 | {
| |
| 35 | System.out.println("Consumed kilowat hours: " + kilowatt );
| |
| 36 | System.out.println("Basic Charge: " + basicCharge);
| |
| 37 | System.out.println("Excess Charge: " + excessCharge);
| |
| 38 | System.out.println("VAT: " + vat);
| |
| 39 | System.out.println("Total Electricity Bill: " + total);
| |
| 40 | ||
| 41 | } | |
| 42 | ||
| 43 | ||
| 44 | ||
| 45 | ||
| 46 | ||
| 47 | ||
| 48 | ||
| 49 | ||
| 50 | ||
| 51 | ||
| 52 | ||
| 53 | ||
| 54 | ||
| 55 | ||
| 56 | } |