/*programmer: Junnaliza Arreglado
*programme name: Direct Clothing Case Study(customer class)
*date started: february 7, 2009
*date ended: february 8, 2009
*programme purpose: to be able to make sulotion for the direct clothing problem*/
public class Customer
{
//customer variable declaration...
private int customerid;
private String name;
private String address;
private int phonenumber;
private String emailaddress;
//customer constructor declaration...
public Customer()
{
}
public Customer(int c, String n, String a, int p, String e)
{
customerid=c;
name=n;
address=a;
phonenumber=p;
emailaddress=e;
}
//customer method declarations...
public void customergreetings(String newname)
{
name=newname;
System.out.println("Hello "+name+" Welcome to DIRECT CLOTHING");
}
public void customerprofile(String newname, int newid, String newaddress, int newphonenumber, String newemailaddress)
{
name=newname;
address=newaddress;
customerid=newid;
phonenumber=newphonenumber;
emailaddress=newemailaddress;
System.out.println("customer's Profile");
System.out.println("Name: "+name+ "\nCustomer ID: "+customerid+"\nAddress:"+address+"\nPhone Number: "+phonenumber+"\nE-mail address: "+emailaddress);
}
}
________________________________________________________________________
/*programmer: Junnaliza Arreglado
*programme name: Direct Clothing Case Study(catalog class)
*date started: february 7, 2009
*date ended: february 8, 2009
*programme purpose: to be able to make sulotion for the direct clothing problem*/
public class Catalog
{
//variable declaration
private int shirtid;
private double price;
private String color;
private String description;
private int quantityinstock;
//costructor declaration
public Catalog()
{
}
public Catalog(int s, double p, String c, String d, int q)
{
shirtid=s;
price=p;
color=c;
description=d;
quantityinstock=q;
}
//method declaration
public void addashirt(int newshirtid, double newprice, String newcolor, String newdescription, int newquantityinstock)
{
shirtid=newshirtid;
price=newprice;
color=newcolor;
description=newdescription;
quantityinstock=newquantityinstock;
System.out.println("Shirt number: "+shirtid+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
System.out.println("The information above has been succesfully added");
}
public void removeashirt(int newshirtid)
{
shirtid=newshirtid;
System.out.println("The Shirt number"+shirtid+"is succesfully remove from the order");
}
}
________________________________________________________________________
/*programmer: Junnaliza Arreglado
*programme name: Direct Clothing Case Study(formofpayment class)
*date started: february 7, 2009
*date ended: february 8, 2009
*programme purpose: to be able to make sulotion for the direct clothing problem*/
public class Formofpayment
{
//variable declaration...
private int checknumber;
private int creditcardnumber;
private String expirationdate;
// constructor declaration..
public Formofpayment()
{
}
public Formofpayment(int c, int cc, String e)
{
checknumber=c;
creditcardnumber=cc;
expirationdate=e;
}
public void verifycreditcard()
{
System.out.println("Your credit card is OK, we will less the amount of this transaction to your credit card");
}
public void verifycheckpayment()
{
System.out.println("OK! You must send the Check in the company before we are going to Send to you your orders!");
}
}
/*programmer: Junnaliza Arreglado
*programme name: Direct Clothing Case Study(shirt class)
*date started: february 7, 2009
*date ended: february 8, 2009
*programme purpose: to be able to make sulotion for the direct clothing problem*/
public class Shirt
{
//variable declaration
private int shirtid;
private double price;
private String color;
private String description;
private int quantityinstock;
//constructor declaration
public Shirt()
{
}
public Shirt(int s, double p, String c, String d, int q)
{
shirtid=s;
price=p;
color=c;
description=d;
quantityinstock=q;
}
//method declaration
public void addshirttoorder(int newshirtid)
{
shirtid=newshirtid;
System.out.println("You have just added Shirt number "+shirtid+" to your orders");
}
public void removeshirttoorder(int newshirtid)
{
shirtid=newshirtid;
System.out.println("Shirt number " +shirtid+ "is successfully remove from the orders");
}
public void displayshirtinformation()
{
System.out.println("Shirt number: "+shirtid+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
}
public void addstock(int newshirtid, double newprice, String newcolor, String newdescription, int newquantityinstock)
{
shirtid=newshirtid;
price=newprice;
color=newcolor;
description=newdescription;
quantityinstock=newquantityinstock;
System.out.println("Shirt number: "+shirtid+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
System.out.println("The information above has been succesfully added");
}
public void removestock(int newshirtid)
{
shirtid=newshirtid;
System.out.println("The Shirt number "+shirtid+" is succesfully remove from the stock");
}
}
/*programmer: Junnaliza Arreglado
*programme name: Direct Clothing Case Study(Order class)
*date started: february 7, 2009
*date ended: february 8, 2009
*programme purpose: to be able to make sulotion for the direct clothing problem*/
public class Order
{
//variable declaration
private int orderid;
private double totalprice;
private String status;
//constuctor declaration
public Order()
{
}
public Order(int o, double t, String s)
{
orderid=o;
totalprice=t;
status=s;
}
//method declaration..
public void placeorder(int newo, double newt, String news)
{
orderid=newo;
totalprice=newt;
status=news;
}
public void removeorder(int o)
{
orderid=o;
System.out.println("Order number "+orderid+" is cancelled succesfully");
}
public void submitorder()
{
System.out.println("You have succesfully submitted the order number "+orderid);
}
public void putorderonhold()
{
System.out.println("The order is still to be proccess by the company.\nJust wait for any reply.");
}
}
/*programmer: Junnaliza Arreglado
*programme name: Direct Clothing Case Study(DirectClotingTester class)
*date started: february 7, 2009
*date ended: february 8, 2009
*programme purpose: to be able to make sulotion for the direct clothing problem*/
import java.util.*;
public class DirectClothingTester
{
public static void main(String args[])
{
String name;
int customerid;
String address;
int phonenumber;
String emailaddress;
int q1;
int q2;
int q3;
int q4;
int cq1;
int cq2;
int shirtid;
double price;
String color;
String description;
int quantity;
int payment;
int ordernumber;
System.out.println("WELCOME TO DIRECT CLOTHING CASE STUDY");
System.out.println("\n");
System.out.println("\n The Company's Side");
System.out.println("\n");
System.out.println("The Shirt in the direct clothing that is currently available is/are:");
System.out.println("\n");
Shirt shirt1=new Shirt(1,258.00,"white and black","Very comfortable to wear",15);
shirt1.displayshirtinformation();
System.out.println("\n");
Scanner z=new Scanner(System.in);
System.out.println("Would you like to add another in the stock?");
System.out.println("enter 1 if yes, 0 if no!");
cq1=z.nextInt();
if(cq1==1)
{
Scanner y=new Scanner(System.in);
System.out.println("Enter the following information:");
System.out.println("Shirt ID:");
shirtid=y.nextInt();
Scanner x=new Scanner(System.in);
System.out.println("Price:");
price=x.nextDouble();
Scanner w=new Scanner(System.in);
System.out.println("Color:");
color=w.nextLine();
Scanner v=new Scanner(System.in);
System.out.println("Description:");
description=v.nextLine();
Scanner u=new Scanner(System.in);
System.out.println("Quantity:");
quantity=u.nextInt();
Shirt shirt2=new Shirt();
shirt2.addstock(shirtid, price, color, description, quantity);
System.out.println("\n");
System.out.println("The Shirt in the direct clothing that is currently available is/are:");
System.out.println("\n");
shirt1.displayshirtinformation();
System.out.println("\n");
shirt2.displayshirtinformation();
}
else
{
System.out.println("OK");
}
System.out.println("\n");
Scanner t=new Scanner(System.in);
System.out.println("Would you like to to remove a stock?");
System.out.println("enter 1 if yes, 0 if no!");
cq2=t.nextInt();
if(cq2==1)
{
Scanner s=new Scanner(System.in);
System.out.println("Enter the Shirt ID number:");
System.out.println("note:just enter shirt id number 1 because it is the only available");
shirtid=s.nextInt();
shirt1.removestock(shirtid);
}
else
{
System.out.println("OK");
}
System.out.println("\n");
System.out.println("WELCOME TO DIRECT CLOTHING CASE STUDY");
System.out.println("\n");
System.out.println("\n The Customer's Side");
System.out.println("\n");
Scanner a=new Scanner(System.in);
System.out.println("Enter your id number:");
customerid=a.nextInt();
Scanner b=new Scanner(System.in);
System.out.println("Enter your name:");
name=b.nextLine();
Scanner c=new Scanner(System.in);
System.out.println("Enter your Address:");
address=c.nextLine();
Scanner d=new Scanner(System.in);
System.out.println("Enter your phone number:");
phonenumber=d.nextInt();
Scanner e=new Scanner(System.in);
System.out.println("Enter your E-mail address:");
emailaddress=e.nextLine();
System.out.println("\n");
Customer customer1=new Customer();
customer1.customergreetings(name);
System.out.println("\n");
customer1.customerprofile(name,customerid,address,phonenumber,emailaddress);
System.out.println("\n");
Scanner f=new Scanner(System.in);
System.out.println("Would you like to make an order?");
System.out.println("enter 1 if yes, 0 if no!");
q1=f.nextInt();
if(q1==1)
{
System.out.println("\n");
System.out.println("Here is the catalog");
System.out.println("\n");
shirt1.displayshirtinformation();
System.out.println("\n");
Scanner g=new Scanner(System.in);
System.out.println("What item you would like to order?");
System.out.println("note:Just enter the shirt id of the item you would like to order");
System.out.println("note:just enter the items available in the catalog");
shirtid=g.nextInt();
System.out.println("\n");
shirt1.addshirttoorder(shirtid);
Scanner h=new Scanner(System.in);
System.out.println("\n");
System.out.println("What type of payment that this transaction will cover?");
System.out.println("Press 1 for check 0 for credit?");
payment=h.nextInt();
if(payment==1)
{
Formofpayment formofpayment1=new Formofpayment();
formofpayment1.verifycheckpayment();
}
else
{
Formofpayment formofpayment1=new Formofpayment();
formofpayment1.verifycreditcard();
}
System.out.println("\n");
Scanner i=new Scanner(System.in);
System.out.println("Would you like to submit your order now?");
System.out.println("enter 1 if yes, 0 if no!");
q2=i.nextInt();
if(q2==1)
{
System.out.println("\n");
Order order1=new Order(1,258,"OK");
order1.submitorder();
order1.putorderonhold();
Scanner j=new Scanner(System.in);
System.out.println("Would you like to remove a shirt from your orders?");
System.out.println("enter 1 if yes, 0 if no!");
q3=j.nextInt();
if(q3==1)
{
System.out.println("\n");
Scanner k=new Scanner(System.in);
System.out.println("Enter the Shirt number that you would like to remove:");
shirtid=k.nextInt();
shirt1.removeshirttoorder(shirtid);
}
else
{
System.out.println("OK!");
}
}
else
{
System.out.println("OK!");
Scanner j=new Scanner(System.in);
System.out.println("Would you like to remove a shirt from your orders?");
System.out.println("enter 1 if yes, 0 if no!");
q3=j.nextInt();
if(q3==1)
{
System.out.println("\n");
Scanner k=new Scanner(System.in);
System.out.println("Enter the Shirt number that you would like to remove:");
shirtid=k.nextInt();
shirt1.removeshirttoorder(shirtid);
}
else
{
System.out.println("OK!");
}
}
}
else
{
System.out.println("OK");
}
Scanner l=new Scanner(System.in);
System.out.println("Would you like to cancel an orders?");
System.out.println("enter 1 if yes, 0 if no!");
q4=l.nextInt();
if(q4==1)
{
System.out.println("\n");
Scanner m=new Scanner(System.in);
System.out.println("Enter the order number that you would like to cancel:");
ordernumber=m.nextInt();
Order order1=new Order(ordernumber,258,"OK");
order1.removeorder(ordernumber);
}
else
{
System.out.println("OK!");
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment