Sunday, February 8, 2009

PROGRAM SOLUTION OF DIRECT CLOTHING CASE STUDY

/*Programmer: Danver G. Palmiano
Date Started: March 23,2009
Date Ended: March 23, 2009
Purpose: For Midterm Purposes
*/
import javax.swing.*;
import java.util.Scanner;

public class ShirtTester{
public static void main(String args[]){
char ans='y';

System.out.println("\tWELCOME TO DANVER's CLOTHING");
System.out.println("\n");
System.out.println("1 Applicatiopn Form");
System.out.println("2 View Catalog");
System.out.println("3 Order");
System.out.println("4 Form of Payment");
System.out.println("5 Erase Order");
System.out.println("6 Finish Order");
System.out.println("\n\n");
System.out.println("Reminders:\tFor you to get correct order pls. follow procedure.");
System.out.println("\t\t\tThank You!");
System.out.println("\n\n");

while(ans=='y')
{int choice=Integer.parseInt(JOptionPane.showInputDialog("Enter procedure:"));

if(choice==1)

{
String b=JOptionPane.showInputDialog("Enter complete name:");
String c=JOptionPane.showInputDialog("Enter City Address:");
int a=Integer.parseInt(JOptionPane.showInputDialog("Enter Phone Number:")); String e=JOptionPane.showInputDialog("Enter E-mail:");


System.out.println("\t\tCUSTOMER PROFILE\n");
System.out.println("Name:\t\t\t"+ b +"\nCity Address\t"+ c +"\nPhone Number:\t"+ a +"\nE-mail:\t\t\t"+ e);
System.out.println("\n");
}

else if(choice==2)

{
Catalog dan=new Catalog();
dan.display(23211300,150,"Blue","Cotton");
System.out.println("\n");
dan.display(23213244,150,"Red","Cotton");
System.out.println("\n");
dan.display(23211300,150,"Yellow","Cotton");
}

else if(choice==3)

{
System.out.println("\tTAKE AN ORDER\n");
System.out.println("1. yes");
System.out.println("2. no");
System.out.println("\n\n");

int choice1=Integer.parseInt(JOptionPane.showInputDialog("Enter choice:"));

if(choice1==1)
{
int order=Integer.parseInt(JOptionPane.showInputDialog("Enter your order:"));System.out.println("You oredered "+ order + " piece/pieces.");
}
else if(choice==2)
{
System.out.println("You must have your order inorder to process order correctly. Thank you!.");
}
}

else if (choice==4)

{
System.out.println("\tTYPE OF PAYMENT\n");
System.out.println("1. Credit Card");
System.out.println("2. Check");
System.out.println("\n\n");

int choice2=Integer.parseInt(JOptionPane.showInputDialog("Enter choice:"));

if(choice2==1)
{
int creditnum=Integer.parseInt(JOptionPane.showInputDialog("Enter credit card number:"));
System.out.println("Credit Card Number:"+creditnum);
System.out.println("\n Note: This order will expire for two weeks if order failure to deliver.");
System.out.println("\t\tThank You!");

}
else if(choice==2)
{
int checknum=Integer.parseInt(JOptionPane.showInputDialog("Enter check number:"));
System.out.println("Check Number:"+checknum);
System.out.println("\n Note: This order will expire for two weeks if order failure to deliver.");
System.out.println("\t\tThank You!");
}
}

else if (choice==5)
{
System.out.println("ERASE ORDER");
System.out.println("You erase previous order. You may continue now.\n");
}

else if (choice==6)
{
System.out.println("\n\n");
System.out.println("Thank you for visiting DANVER's CLOTHING");
System.out.println("Your order will deliver as soon as possible. Thank You!");

}

String a=JOptionPane.showInputDialog("Enter key 'y' to continue order, if not, no order happen:");
ans=a.charAt(0);
}




}
}




/*Programmer: Danver G. Palmiano
Date Started: February 9,2009
Date Ended: February 9, 2009
Purpose: For Midterm Purposes
*/

public class Catalog {
private int shirtID;
private int price;
private String color;
private String description;


public Catalog()
{

}

public Catalog(int sID, int p, String c, String d)
{
shirtID=sID;
price=p;
color=c;
description=d;
}

void display(int sID, int p, String c, String d)
{
System.out.println("\t\tSHIRT CATALOG\n");
System.out.println("\nID num:\t\t\t"+ sID +"\nPrice:\t\t\t"+ p +"\nColor:\t\t\t "+ c +"\nDescription:\t"+d);
}

//add method
//add stock shirt
public void add(int newshirtID)
{
shirtID=newshirtID;
}

//remove method
//remove stock shirt
public void remove(int newshirtID)
{
shirtID=newshirtID;
}

}
___________________________________________________________________________

public class Payment {
private int checkNum;
private int creditcardNum;
private int expirationcardDate;

public Payment()
{
}

public Payment(int cN, int ccN, int ecD)
{
checkNum=cN;
creditcardNum=ccN;
expirationcardDate=ecD;
}

public void verifycardNum()
{
System.out.println("Your card has been verified. Thank you");
}


public void verifycheckPayment()
{
System.out.println("Your check has been verified. Thank you");
}

}

______________________________________________________________________

public class Shirt {

private int shirtID;
private int price;
private String color;
private String description;
private int stock;


public Shirt()
{
}

public Shirt(int sID, int p, String c, String d, int s)
{
shirtID=sID;
price=p;
color=c;
description=d;
stock=s;
}

//add method
public void add(int newshirtID)
{
shirtID=newshirtID;
}


//remove method
public void remove(int newshirtID)
{
shirtID=newshirtID;
}

//display item method
public void display()
{
System.out.println("Shirt IDnum:"+shirtID);
System.out.println("Price:"+price);
System.out.println("Color:"+color);
System.out.println("Description:"+description);
}

//add method
public void addstock(int newshirtID, int newprice, String newcolor, String newdescription)
{
shirtID = newshirtID;
price = newprice;
color = newcolor;
description = newdescription;
System.out.println("Shirt IDnum:"+shirtID);
System.out.println("Price:"+price);
System.out.println("Color:"+color);
System.out.println("Description:"+description);

}
//remove method
public void removestock(int newshirtID)
{
shirtID=newshirtID;
}



}
_______________________________________________________________________________

public class Customer {

private int customerID;
private String Name;
private String Address;
private int phoneNum;
private String email;


public Customer()
{

}

public Customer(int c, String n, String a, int p, String e)
{
customerID=c;
Name=n;
Address=a;
phoneNum=p;
}

public void placeOrder()
{
}
public void cancelOrder()
{
}
}
_________________________________________________________________________________

public class Order{

private int orderID;
private int totalPrice;
private String status;

public Order()
{

}

public Order(int oID, int tP, String s)
{
this.orderID=oID;
this.totalPrice=tP;
this.status=s;
}

public void placeOrder(int newOrderID)
{
orderID=newOrderID;
System.out.println("You place an Order");
}

public void removeOrder(int newOrderID)
{
orderID=newOrderID;
System.out.println("You removed your order");
}

public void submitOrder()
{
System.out.println("Thank you! Your order will deliver as soon as possible.");
}
}



}

No comments:

Post a Comment