Commit d1489dbe authored by dan.foskett's avatar dan.foskett

initial comment

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Assignment-One.git.first</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=14
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=14
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=14
import java.util.Scanner;
public class Menu {
static String menu[] = {"","Code 01 Pizza 10","Code 02 Steak 7","Code 03 Sandwich 5","Code 04 Water 1", "Code 05 Soft drink 2","Code 06 Tea 2","Code 07 Coffee 2","Code 08 Ice cream 2","Code 09 Chocolate 2"};
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("This is our Menu.");
for(int i = 1; i < 9; i++) {
System.out.println("[" + menu[i] + "] ");
}
Scanner myObj = new Scanner(System.in);
System.out.println("Please type the item you want.");
String order = myObj.nextLine(); // Reads the user input
System.out.println("The item you wish to be is " + order );
System.out.println("Please type PAY to pay for your order.");
String pay = myObj.nextLine(); // Reads the user input
System.out.println("Thank you for booking with us, your seat and order is now done.");
}
}
import java.util.Scanner;
public class Seats {
static String seat[] = {"","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42"};
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i < 43; i++)
{if(i == 7 || i == 21 || i == 35 || i == 42) {
System.out.println("[" + seat[i] + "] ");
}
else if(i == 14 || i == 28) {
System.out.println("[" + seat[i] + "] ");
System.out.println("");
}
else {
System.out.print("[" + seat[i] + "] ");
}
}
Scanner myObj = new Scanner(System.in);
System.out.println("Please enter the seat(s) you wish to book."); // Asks the user to input the seat they want.
int choiceseat = Integer.parseInt(myObj.nextLine()); // Converts the input into a string.
seat[choiceseat] = "XX"; // Replaces their seat with "XX"
//Printing the table again with their choice crossed out.
for(int i = 1; i < 43; i++)
{if(i == 7 || i == 21 || i == 35 || i == 42) {
System.out.println("[" + seat[i] + "] ");
}
else if(i == 14 || i == 28) {
System.out.println("[" + seat[i] + "] ");
System.out.println("");
}
else {
System.out.print("[" + seat[i] + "] ");
}
}
System.out.println("The seat you have booked is " + choiceseat + ".");
}
}
\ No newline at end of file
import java.util.Scanner;
public class test {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner myObj = new Scanner(System.in);
System.out.println("Hello and welcome to our resturant. Please enter your name to continue.");
String userName = myObj.nextLine(); // Reads the user input
System.out.println("your username is " + userName);
Seats.main(args); // Calling Seats class
Menu.main(args); // Calling Menu class
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment