Assignement: 101 Using Methods To make an Order Form
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: KeyChainsForSale
/// File Name: KeyChainsforSale.java
/// Date Finished: 3/31/2016
import java.util.Scanner;
public class KeyChainsForSale
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int choice;
choice = 0;
while (choice != 4)
{
System.out.println( "Ye Olde Kyechain Shoppe" );
System.out.println();
System.out.println( "1. Add Keychains to Order" );
System.out.println( "2. Remove Kyechains from Order" );
System.out.println( "3. View Current Order" );
System.out.println( "4. Checkout" );
System.out.println();
System.out.print( "Please enter your choice: " );
choice = keyboard.nextInt();
if ( choice == 1 )
{
Order();
}
else if ( choice == 2 )
{
Remove();
}
else if ( choice == 3 )
{
View();
}
else if ( choice == 4 )
{
Checkout();
}
else
{
choice = 4;
Checkout();
}
}
}
public static void Order()
{
System.out.println( "ADD KEYCHAINS" );
}
public static void Remove()
{
System.out.println( "REMOVE KECHAINS" );
}
public static void View()
{
System.out.println( "VIEW ORDER" );
}
public static void Checkout()
{
System.out.println( "CHECKOUT" );
}
}
Picture of the output