/* Programmer: Maribelle Lacno
* Program name: Direct Clothing Case study
* Subject: IT134_Computer Programming 3
* Instructor: Mr. Dony Dongiapon
* Date Started: 02/09/09
* Date Finished: 02/09/09
* Purpose: To create an online direct clothing case study.
*/
catalog
public class catalog{
private void addShirt(){
System.out.println("\nShirt jacket is in catalog");
}
private void removeShirt(){
System.out.println("\nShirt jacket is not in catalog");
}
public catalog(String newShirt){
clothes = newShirt;
this.addShirt();
}
public catalog(){
this.removeShirt();
}
}
shirt
public class shirt{
private int shirtID;
private double price;
private String color;
private String description;
private int quantity;
private void addStock(){
customer me = new customer(20060413,"Maribelle","Calapagan",629355,"tulipslady@gmail.com");
}
private void removeStock(){
catalog clothes = new catalog();
System.out.println("\nJacket has been removed!");
customer me = new customer();
}
public void displayShirtInfo(){
catalog clothes = new catalog("jacket");
System.out.print("\nShirt Information: \nShirtID = "+shirtID+"\nPrice: "+price);
System.out.print("\nColor: "+color+"\nDescription: "+description+"\nQuantity: "+quantity);
}
public shirt(int newID, double newPrice, String newColor, String newDescription, int newQuantity){
shirtID = newID;
price = newPrice;
color = newColor;
description = newDescription;
quantity = newQuantity;
this.addStock();
}
public shirt(){
this.removeStock();
}
}
customer
public class customer{
private int customerID;
private String name;
private String address;
private int phoneNumber;
private String emailAddress;
private void placeOrder(){
System.out.print("\nCustomer "+name+" with an id of "+customerID+"\nwho lived in "+address+", and has a phone number "+phoneNumber);
System.out.print("\nand email address of "+emailAddress+" wants to make an order.");
order myOrder = new order(01,600.00,"available");
}
private void cancelOrder(){
System.out.print("\nOrder has been cancelled!");
order myOrder = new order();
}
public customer(int cusID, String cusName, String cusAddress, int cusPhoneNumber, String cusEmailAddress){
customerID = cusID;
name = cusName;
address = cusAddress;
phoneNumber = cusPhoneNumber;
emailAddress = cusEmailAddress;
this.placeOrder();
}
public customer(){
this.cancelOrder();
}
}
order
import java.util.Scanner;
public class order{
Scanner scan = new Scanner(System.in);
private int orderID;
private double totalPrice;
private String status;
private void addShirtToOrder(){
System.out.print("\nYour shirt has been added to order!");
}
private void removeShirtFromOrder(){
System.out.print("\nYour shirt has been removed from order!");
}
public void submitOrder(){
System.out.print("\nWhat form of payment you have? choose 1(check) or 0(credit card): ");
int choice = scan.nextInt();
if(choice==1){
formOfPayment balance = new formOfPayment();
}else{
formOfPayment balance = new formOfPayment(7895,"Feb.14,2009");
}
this.addShirtToOrder();
}
public void putOrderOnHold(){
this.removeShirtFromOrder();
}
public order(int newOrderID, double totalAmount, String availability){
orderID = newOrderID;
totalPrice = totalAmount;
status = availability;
this.submitOrder();
}
public order(){
this.putOrderOnHold();
}
}
formOfPayment
import java.util.Scanner;
public class formOfPayment{
Scanner scan = new Scanner(System.in);
private int checkNumber;
private int creditCardNumber;
private String expirationDate;
private void verifyCreditCardNumber(){
System.out.print("\nCredit Card number accepted!");
}
private void verifyCheckPayment(){
System.out.print("\nCheck number accepted!");
}
public formOfPayment(int newCreditCardNumber, String dateExpiration){
creditCardNumber = newCreditCardNumber;
expirationDate = dateExpiration;
this.verifyCreditCardNumber();
}
public formOfPayment(){
this.verifyCheckPayment();
}
}
directClothingTester
import java.util.Scanner;
public class directClothingTester{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.print("\n*Welcome to Online Direct Clothing*\nAn official website in which you can order different clothes.");
System.out.print("\nDo you want to make an order? choose 1(yes) or 0(no): ");
int choice = scan.nextInt();
if(choice==1){
shirt jacket = new shirt(9863,300.00,"green","small",8);
jacket.displayShirtInfo();
}else{
System.out.print("\nDo you want to removed an existing order? choose 1(yes) or 0(no): ");
int answer = scan.nextInt();
if(answer==1){
shirt jacket = new shirt();
}else{
System.out.println("\nThanks for ordering!");
}
}
}
}
No comments:
Post a Comment