Assignment #101
Code
/*
jack newsom
period 5
program Keychains
filename Keychains.java
date completed 11/4/2015
*/
import java.util.Scanner;
public class Keychains
{
public static void main( String[] args )
{
Scanner bot = new Scanner(System.in);
System.out.println("Ye Olde Keychain Shoppe");
System.out.println();
int selection = 0;
while ( selection != 4 )
{
System.out.println("1.\tAdd Keychains to Order");
System.out.println("2.\tRemove Keychains from Order");
System.out.println("3.\tView Current Order");
System.out.println("4.\tCheckout");
System.out.println("");
System.out.println("Please enter your choice: ");
selection = bot.nextInt();
if ( selection == 1 )
addKeychains();
else if ( selection == 2 )
removeKeychains();
else if ( selection == 3 )
viewOrder();
else if ( selection == 4 )
checkout();
else
{
do
{
System.out.println("Whoops. You didn't select a valid option. Try again.");
System.out.println("");
System.out.println("1.\tAdd Keychains to Order");
System.out.println("2.\tRemove Keychains from Order");
System.out.println("3.\tView Current Order");
System.out.println("4.\tCheckout");
System.out.println("");
System.out.println("Please enter your choice: ");
selection = bot.nextInt();
} while ( selection > 4 || selection < 1 );
}
}
}
public static void addKeychains( )
{
System.out.println("ADD KEYCHAINS");
}
public static void removeKeychains( )
{
System.out.println("REMOVE KEYCHAINS");
}
public static void viewOrder( )
{
System.out.println("VIEW ORDER");
}
public static void checkout( )
{
System.out.println("CHECKOUT");
}
}
Picture of the output