order
unknown
plain_text
3 years ago
2.5 kB
9
Indexable
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package l03;
/**
*
* @author HP
*/
public class Order {
Manager mn = new Manager();
private int fruitID;
private String fruitName;
private int quantity;
private double price;
private String customer;
/**
* constructor Order
*/
public Order() {
}
/**
* constructor Order
*
* @param fruitID
* @param fruitName
* @param quantity
* @param price
* @param customer
*/
public Order(int fruitID, String fruitName, int quantity, double price, String customer) {
this.fruitID = fruitID;
this.fruitName = fruitName;
this.quantity = quantity;
this.price = price;
this.customer = customer;
}
/**
* getFruitID
*
* @return
*/
public int getFruitID() {
return fruitID;
}
/**
* setFruitID
*
* @param fruitID
*/
public void setFruitID(int fruitID) {
this.fruitID = fruitID;
}
/**
* getFruitName
*
* @return
*/
public String getFruitName() {
return fruitName;
}
/**
* setFruitName
*
* @param fruitName
*/
public void setFruitName(String fruitName) {
this.fruitName = fruitName;
}
/**
* getQuantity
*
* @return
*/
public int getQuantity() {
return quantity;
}
/**
* setQuantity
*
* @param quantity
*/
public void setQuantity(int quantity) {
this.quantity = quantity;
}
/**
* getPrice
*
* @return
*/
public double getPrice() {
return price;
}
/**
* setPrice
*
* @param price
*/
public void setPrice(double price) {
this.price = price;
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
public void print(){
System.out.printf("|%-10s|%20s|%16s|%8s|\n", "Product", "Quantity", "Price", "Amount");
System.out.printf("|%-10s|%20s|%16s|%8s|\n", fruitName, quantity, price, price*quantity);
}
}
Editor is loading...