Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Record {
- //instance vars go here
- public Record (String ord, String reg, String cus, String ite, int uni, double cos ) {
- Date date = new Date(ord);
- } //end constructor
- public String recToString (boolean format) {
- if(format == true){
- return "" + getOrderDate(true) + "\t" + getRegion() + "\t" + getCustomer() + "\t" + getItem() + "\t" + getCost() + "\t" + getUnits() + "\t" + getTotal();
- }
- else{
- return "" + getOrderDate(false) + "\t" + getRegion() + "\t" + getCustomer() + "\t" + getItem() + "\t" + getCost() + "\t" + getUnits() + "\t" + getTotal();
- }
- } //end recToString
- public String getOrderDate(boolean format) {
- if(format == true){
- return date.usFormat();
- }
- else{
- return date.euFormat();
- }
- } //end getOrderDate
- public String getRegion() {
- return reg;
- } //end getRegion
- public String getCustomer() {
- return cus;
- } //end getCustomer
- public String getItem() {
- return ite;
- } //end getItem
- public int getUnits() {
- return uni;
- } //end getUnits
- public double getCost() {
- return cos;
- } //end getCost
- public double getTotal() {
- return this.cos * this.uni;
- } //end getTotal
- } //end class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement