catalog
/** Programmer: Nerissa Agapay
* Program: Catalog.java
* Date Strated : February 6,2009
* Date Ended: February 9,2009
*
*/
public class Catalog {
private int ShirtID;
private double Price;
private String Color;
private String Description;
private int QuantityInStock;
public Catalog(int SID, double P, String D,String C, int QIS)
{
ShirtID=SID;
Price=P;
Color=C;
Description=D;
QuantityInStock=QIS;
}
public void addshirt(int newsid, double newpri, String newcol, String newdes, int newqua)
{
ShirtID=newsid;
Price=newpri;
Color=newcol;
Description=newdes;
QuantityInStock=newqua;
System.out.println("Shirt number: "+ShirtID);
System.out.println("Price: "+Price);
System.out.println("Color: "+Color);
System.out.println("Description: "+Description);
System.out.println("Quantity in Stock: "+QuantityInStock);
System.out.println("The product was succesfully added!");
}
}
order
public class Order {
private int OrderID;
private double TotalPrice;
private String Status;
public Order()
{
}
public Order(int newOI, double newTP, String newS)
{
OrderID=newOI;
TotalPrice=newTP;
Status=newS;
}
public void OrderCancel(int newoid)
{
OrderID=newoid;
System.out.print("Order cancelled"+OrderID);
}
public void AddOrder()
{
System.out.println("The shirt has been added to your order "+OrderID);
}
}
FormofPayment
public class FormofPayment {
private int CheckNum;
private int CCN;
private String ExpDate;
private void VerifyCreditCardNumber(){
System.out.print("\nCredit Card number ok!");
}
private void VerifyCheckPayment(){
System.out.print("Check number ok!");
}
public FormofPayment(int newCCN, String newExpDate){
CCN = newCCN;
ExpDate = newExpDate;
this.VerifyCreditCardNumber();
}
public FormofPayment(){
this.VerifyCheckPayment();
}
}
shirt
public class Shirt {
private int ShirtID;
private int Price;
private String Color;
private String Description;
private int QuatityInStock;
public Shirt(int SID, int P, String C, String D,int QIS ){
ShirtID=SID;
Price=P;
Color=C;
Description=D;
QuatityInStock=QIS;
}
private void AddStock{
customer stock=new customer("012+ Lindsay+Davao City");
System.out.println("The stock was added!");
}
private void RemoveStock{
System.out.println(" ");
System.out.println("Succesfully Remove!!");
}
public void DisplayShirtInformation{
System.out.println("Information:+ 1112+ 250php+ green+ Small+ 4);
}
customer
public class Customer {
private int CustomerID;
private String Name;
private String Address;
private int PhoneNum;
private EMD;
private void placeOrder(){
System.out.print("\nName+"\n, from "+Address+" has a phone number "+PhoneNum);
System.out.print("\nand email add "+EMD+" have an order.");
Order avon = new Order(6,450.00,"available");
}
private void cancelOrder(){
System.out.print("\nCancelled order!");
Order avon = new Order();
}
public Customer(int cusID, String cusName, String cusAddress, int cusPhoneNumber, String cusEmail){
CustomerID = cusID;
Name = cusName;
Address = cusAddress;
PhoneNum = cusPhoneNumber;
EMD = cusEmail;
this.placeOrder();
}
public Customer(){
this.cancelOrder();
}
}
DSCTester
import javax.swing.*;
public class DSCTester {
public static void main(String[]args){
int choice;
System.out.println("\t\tWhat do you want to do?");
System.out.println("1.Place an order");
System.out.println("2. Cancel an order");
choice=Integer.parseInt(JOptionPane.showInputDialog("Enter your choice"));
if(choice==1) {
Customer risa = new Customer(456,"Nerissa","Davao",237,"lindsay_2001@yahoo.com");
}else if(choice==2){
Customer risa = new Customer();
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment