+ 1
can anyone make me an ordering system object oriented program? it's for an assignment, sorry for the trouble
6 Respuestas
+ 3
Pizzaorder.java:
package Assign1;
public class PizzaOrder {
//declaring variables
private int id;
private String name;
private String phoneNumber;
private String order;
private String type;
//constructor
public PizzaOrder() {
setId (1000);
setName ("testname");
setPhoneNumber ("xxxx");
setOrder ("testorder");
setType ("testtype");
}
//setters
public void setId(int id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public void setOrder(String order) {
this.order = order;
}
public void setType(String type) {
this.type = type;
}
//getters
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getPhoneNumber() {
return phoneNumber;
}
public String getOrder() {
return order;
}
public String getT
0
umm, wait...
0
how do i send pictures here?
0
public class orderingMain{
static orderingList op1 = new orderingList();
static logo logox = new logo();
public static void main(String [] order){
logox.logoGenerate();
op1.listOder();
}
}
0
public class orderingList{
public static String [] prod = {"Nintendo Switch-15700", "Sony PlayStation4-15822", "Microsoft Xbox360-10500", "Microsoft XboxOneX-8455","Sony PlayStation4 Slim-12000"};
static optionMenu opMen = new optionMenu();
public void listOder(){
System.out.println("FOOD MENU: \n");
for(int x = 0; x < prod.length; x++){
System.out.println("[" + (x + 1) + "]" + prod[x]);
}
opMen.orderOption();
}
}
0
PizzaorderManager.java:
package Assign1;
import java.util.Scanner;
public class PizzaOrderManager {
public static void main(String[] args) {
// Declare Variables
int numberOfPizzasOrdered;
int numberOfCurrentPizza = 1;
//Declare input Scanners
Scanner numberOfPizzasOrderedScanner = new Scanner(System.in);
Scanner scanner = new Scanner(System.in);
//Adding a new Order
System.out.println("Pizza Order Manager");
System.out.println("===================");
System.out.println("");
System.out.print("Enter number of Pizza Orders: ");
numberOfPizzasOrdered = numberOfPizzasOrderedScanner.nextInt();
System.out.println("");
//declaring a counter
int i = 1;
//creating a loop to display entry details for pizzas
while (i<=numberOfPizzasOrdered){
System.out.println("Enter Details of Pizza Order " + numberOfCurrentPizza + ":");
System.out.println("===================");
//Details of the new order
PizzaOrder p1 = new PizzaOrder