Sunday, February 8, 2009

Direct clothing Case Study

/*Programmer:Mary Grace Cuming
Date Started:February 7,2009
Date Ended:February 8,2009 Program name:Direct Clothing CAse Study Solution(Class Shirt) */


public class Shirt {
private String shirtID; private double price; private String color; private int quantity; private String description;
public Shirt(){ }
public Shirt(String newshirtID,double newprice,String newcolor, int newquantity,String newdescription){ //constructor
shirtID= newshirtID; price=newprice; color= newcolor; quantity=newquantity; description=newdescription;}
//method add stockpublic void setShirtID(String newshirtID){ shirtID= newshirtID;}
public String getShirtID(){ return shirtID;} public void setPrice(double newprice){ price=newprice;}public double getPrice(){ return price;}
public void setColor(String newcolor){ color= newcolor;}public String getColor(){ return color;}
public void setQuantity(int newquantity){ quantity=newquantity;}public int getQuantity(){ return quantity;}public void setDescription(String newdescription){ description=newdescription;}public String getDescription(){ return description;}public String("
public String removestock(){ System.out.println("The Shirt with an ID\t\s getShirtID()); System.out.println("was successfully remove.Thank you!!!");}
}
________________________________________________________________

/*Programmer:Mary Grace Cuming
Date Started:February 7,2009
Date Ended:February 8,2009 Program name:Direct Clothing CAse Study Solution(Class Order) */

public class Order{ private String orderID; private double totalprice; private String status;
public Order(){}
public void orderShirt(String neworderID,double newtotalorderprice,String newstatus){ String orderID=neworderID; double totalorderprice=newtotalorderprice; String status=newstatus;}public void setOrderID(String neworderID){ String orderID=neworderID;}public String getOrderID(){ return orderID;}public void setTotaltorderprice(double newtotalorderprice){ double totalorderprice=newtotalorderprice;}public double getTotaltorderprice(){ return totalorderprice;}public void setStatus(String newstatus){ String status=newstatus;}public String getStatus(){ return status;}}

_____________________________________________________________

/*Programmer:Mary Grace Cuming
Date Started:February 7,2009
Date Ended:February 8,2009 Program name:Direct Clothing CAse Study Solution(Class FormofPayment) */

public class FormofPayment{ private String checknumber; private String cardnumber; private String expirationDate;
public FormofPayment(String check,String card,String date)
//constructor{
checknumber=check; cardnumber=card; expirationDate=date }
//methodpublic void setChecknumber(String check){ checknumber=check;} public String getChecknumber(){ return checknumber;}
public void setCardnumber(String card){ cardnumber=card;} public String getCardnumber(){ return cardnumber;}
public void setExpirationdate(String date){ expirationDate=date;} public String getExpirationdate(){ returnexpirationDate;}public void Dispalymessage(){ System.out.println("Your checknumber is:%s/nand checknumber is:%s");
}
}
__________________________________________________________

/*Programmer:Mary Grace Cuming
Date Started:February 7,2009
Date Ended:February 8,2009 Program name:Direct Clothing CAse Study Solution(Class Catalog) */
public class Catalog {
public void displayCatalog(){ System.out.println("ShirtID:252-22\nPrice:25,000\nColor:Black \nQuantity:5\nDescription:Beautiful"); System.out.println("ShirtID:252-54\nPrice:90,000\nColor:Pink\nQuantity:1\nDescription:Nice");}}

____________________________________________________________

/*Programmer:Mary Grace Cuming
Date Started:February 7,2009
Date Ended:February 8,2009 Program name:Direct Clothing CAse Study Solution(Class Order) */

public class Order{ private String orderID; private double totalprice; private String status;
public Order(){}
public void orderShirt(String neworderID,double newtotalorderprice,String newstatus){ String orderID=neworderID; double totalorderprice=newtotalorderprice; String status=newstatus;}public void setOrderID(String neworderID){ String orderID=neworderID;}public String getOrderID(){ return orderID;}public void setTotaltorderprice(double newtotalorderprice){ double totalorderprice=newtotalorderprice;}public double getTotaltorderprice(){ return totalorderprice;}public void setStatus(String newstatus){ String status=newstatus;}public String getStatus(){ return status;}}
____________________________________________________________

/*Programmer:Mary Grace Cuming
Date Started:February 7,2009
Date Ended:February 8,2009
Program name:Direct Clothing CAse Study Solution(Class ClothingTester) */

import java.util.Scanner;
public class ClothingTester{ public static void main(String args[]) { Scanner input= new Scanner(System.in); Shirt myShirt=new Shirt(); System.out.println("Welcome to Direct Clothing:\n\nHere's our Catalog?"); myShirt.displayCatalog(); Scanner input= new Scanner(System.in); System.out.println("Want to add a stock?"); if (input=='y') { System.out.println("Enter ShirtID:"); String ID=input.nextLine(); myShirt.setShirtID(ID); System.out.println(); System.out.println("Enter Price:"); double cprice=input.nextDouble(); myShirt.setPrice(cprice); System.out.println();
System.out.println("Enter Color:"); String ccolor=input.nextLine(); myShirt.setColor(ccolor); System.out.println(); System.out.println("Enter Quantity:"); int cquantity=input.nextInt(); myShirt.setQuantity(cquantity); System.out.println(); System.out.println("Enter shirt Description:"); String cdescription=input.nextLine(); myShirt.setDescription(cdescription); System.out.println(); System.out.println("The shirt was Successfully Added.\n\n\t Thank You!!!"); } else { System.out.println("Ok"); } } }

No comments:

Post a Comment