/*Programmer: Cristine A. Salac
Program Name:Catalog class (Direct Clothing Case Study)
Date Started: 02/08/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
public class Catalog
{
//variable declaration
private int shirtID;
private double price;
private String color;
private String description;
private int quantityinstock;
//constructor Definition
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
public void addshirt(int newshirtID, double newprice, String newcolor, String newdescription, int newquantityinstock)
{
shirtID=newshirtID;
price=newprice;
color=newcolor;
description=newdescription;
quantityinstock=newquantityinstock;
System.out.println("Here are the info of our catalog:);
System.out.println("Shirt number: "+shirtID+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
}
public void removeshirt(int newshirtID)
{
shirtID=newshirtID;
System.out.println("The Shirt number"+shirtid+"has been remove from the order");
}
}
/*Programmer: Cristine A. Salac
Program Name:Customer class (Direct Clothing Case Study)
Date Started: 02/08/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
public class Customer
{
// variable declaration
private int CustomerID;
private String Name;
private String Address;
private int Phonenumber;
private String Emailaddress;
//constructor Definition
public Customer()
{
}
public Customer(int c, String n, String a, int p, String e)
{
CustomerID=c;
Name=n;
Address=a;
Phonenumber=p;
Emailaddress=e;
}
//method
public void customerprofile(String newname, int newid, String newaddress, int newphonenumber, String newemailaddress)
{
CustomerID=newid;
Name=newname;
Address=newaddress;
Phonenumber=newphonenumber;
Emailaddress=newemailaddress;
system.out.println("Customer's Information:");
system.out.println( "\nCustomerID: "+CustomerID+" \nName: "+Name+" \nAddress: "+Address+" \nPhonenumber: "+Phonenumber+" \nEmailaddress: "+Emailaddress);
}
}
/*Programmer: Cristine A. Salac
Program Name:Order class (Direct Clothing Case Study)
Date Started: 02/08/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
public class Order
{
//variable declaration
private int OrderID;
private double Totalprice;
private String Status;
//constructor Definition
public Order()
{
}
public Order(int o, double t, String s)
{
OrderID=o;
Totalprice=t;
Status=s;
}
//method declaration
public void addorder(int neworder, double newtotalprice, String newstatus)
{
OrderID=neworder;
Totalprice=newtotalprice;
Status=newstatus;
}
public void removeorder(int order)
{
OrderID=order;
System.out.println("Order number: "+OrderID+" has been remove");
}
public void submitOrder()
{
OrderID=order;
System.out.println("Order number has been submitted "+OrderID);
}
public void putorderonhold()
{
System.out.println("The order is still on proccess");
}
}
/*Programmer: Cristine A. Salac
Program Name:Shirt class (Direct Clothing Case Study)
Date Started: 02/08/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
public class Shirt
{
//variable declaration
private int ShirtID;
private double price;
private String description;
private String color;
private int quantityinstock;
//constructor Definiton
public Shirt()
{
}
public Shirt(int s, double p, String d, String c, int q)
{
ShirtID=s;
price=p;
description=d;
color=c;
quantityinstock=q;
}
//method
public void addstock(int newShirtID, double newprice, String newcolor, String newdescription, int newquantityinstock)
{
ShirtID=newShirtID;
Price=newprice;
Description=newdescription;
Color=newcolor;
Quantityinstock=newquantityinstock;
System.out.println("Shirt number: "+ShirtID+ "\nPrice: "+price+"\nDescription: "+description+"\nColor:"+color+"\nQuantity in Stock: "+quantityinstock);
System.out.println("Information has been added");
}
public void removestock(int newShirtID)
{
ShirtID=newShirtID;
System.out.println("The Shirt number "+ShirtID+" has been remove from the stock");
}
public void displayshirtinformation()
{
System.out.println("Shirt number: "+ShirtID+" \nPrice: "+price+" \nDescription: "+description+" \nColor: "+color+" \nQuantity in Stock: "+quantityinstock);
}
}
/*Programmer: Cristine A. Salac
Program Name:FormOfPayment class (Direct Clothing Case Study)
Date Started: 02/08/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
public class FormOfPayment
{
//variable declaration
private int Checknumber;
private int Creditcardnumber;
private String Expirationdate;
// constructor Definiton
public FormOfPayment()
{
}
public FormOfPayment(int c, int ccn, String e)
{
Checknumber=c;
Creditcardnumber=ccn;
Expirationdate=e;
}
public void verifyCreditcard()
{
System.out.println("Your credit card is OK ");
}
public void verifyCheckpayment()
{
System.out.println("You must send the Check first to our company so that we can send your orders");
}
}
/*Programmer: Cristine A. Salac
Program Name:Clothing Tester(Direct Clothing Case Study)
Date Started: 02/08/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
import java.util.Scanner;
public class Clothing Tester
{
public static void main(String args[])
{
int Y;
System.out.println("Welcome To Direct Clothing Case Study");
{
Scanner input=new scanner(System.in);
Shirt myShirt=new Shirt();
System.out.println("Welcome to Direct cothing");
System.out.println("Here's our Catalog:");
myShirt.displayCatalog();
Scanner input=newScanner(System.in);
System.out.println("Do you want to add a stock?");
if(input=='Y')
{
system.out.println("Enter ShirtID:");
String ID=input.nextLine();
myShirt.setShirtID(ID);
System.out.println("\n");
System.outprintln("Enter Price:");
double price-input.nextDouble();
myShirt.setPrice(price);
System.out.println("\n");
System.out.println("Enter Color:");
String color=input.nextLine();
myShirt.setColor(color);
System.out.println(\n");
System.out.println("Enter Quantity:");
int quantity-input.nextInt();
myShirt.setQuantity(quanity);
System.out.println("\n");
System.out.println("Enter shirt Description:");
String description=input.nextLine();
myShirt.setDescription(description);
System.out.println("\n");
System.out.println("Done?");
if(input=='Y')
{
System.out.println("The shirt has been added.");
}
else
{
System.out.println("Ok");
}
}
}
}
No comments:
Post a Comment