0% found this document useful (0 votes)
27 views1 page

It 22

The document defines a TahaoPetronStation class that models a gas station. The class tracks details of a customer transaction like fuel types purchased and amounts, as well as calculating a total amount payable. Methods are included to set the name, address, plate number, and transaction details of a customer, and to retrieve the receipt number or total payable amount.

Uploaded by

Pete Abareta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

It 22

The document defines a TahaoPetronStation class that models a gas station. The class tracks details of a customer transaction like fuel types purchased and amounts, as well as calculating a total amount payable. Methods are included to set the name, address, plate number, and transaction details of a customer, and to retrieve the receipt number or total payable amount.

Uploaded by

Pete Abareta
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

public class TahaoPetronStation{ LPG=51.

77*quantity;
private String name; }
private String address; public void setTotalAmountPayable(){
private String platenumber; totalamountpayable=diesel+xcs+unleaded+
private int receiptnumber; regular+kerosene+LPG;
private double diesel; }
private double xcs; }
private double unleaded;
private double regular;
private double kerosene; *prices may vary.
private double LPG;
private double totalamountpayable;
public String getName(){
return name;
}
public String getAddress(){
return address;
}
public String getPlateNumber(){
return platenumber;
}
public int getReceiptNumber(){
receiptnumber++;
return receiptnumber;
}
public double getTotalAmountPayable(){
return totalamountpayable;
}
public void setName(String v){
name=v;
}
public void setAddress(String w){
address=w;
}
public void setPlateNumber(String x){
platenumber=x;
}
public void setDiesel(double quantity){
diesel=50.90*quantity;
}
public void setXCS (double quantity){
xcs=51.32*quantity;
}
public void setUnleaded(double quantity){
unleaded=48.66*quantity;
}
public void setRegular(double quantity){
regular=47.63*quantity;
}
public void setKerosene(double quantity){
kerosene=29.43*quantity;
} ABARETA, Pete Francis R.
public void setLPG(double quantity){ BS Information Technology 2B

You might also like