Guest User

Untitled

a guest
Jan 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Lot{
  4.     public static void main(String args[]){
  5.        
  6.     // Initializing
  7.         Scanner in = new Scanner(System.in);
  8.         float PlayerCash = 5;
  9.        
  10.     // Brief introduction
  11.     System.out.println("=======================================================");
  12.     System.out.println("Welcome to 'Group A' lottery. You have $"+PlayerCash);
  13.     System.out.println("=======================================================");
  14.     System.out.println("Please enter how many lines would you like to purchase. One line costs .50 Cents. \nNote: 4 Lines is the maximum you can purchase.");
  15.  
  16.     // Getting users line choice.
  17.     int LineChoice = in.nextInt();
  18.     if( LineChoice > 4 || LineChoice < 0){
  19.         System.out.println("Sorry but "+LineChoice+" is invalid amount of lines. Please try again.");
  20.         System.exit(0);
  21.     }
  22.  
  23.  
  24.     // Creating 2D Array. 4 Columns for users numbers and 4 rows for line choices. 4x4 = 16 cells in total.
  25.     int[][] Lines = new int[4][4];
  26.         Lines[0][0] = in.nextInt();
  27.         Lines[0][1] = in.nextInt();
  28.         Lines[0][2] = in.nextInt();
  29.         Lines[0][3] = in.nextInt();
  30.         Lines[1][0] = in.nextInt();
  31.         Lines[1][1] = in.nextInt();
  32.         Lines[1][2] = in.nextInt();
  33.         Lines[1][3] = in.nextInt();
  34.         Lines[2][0] = in.nextInt();
  35.         Lines[2][1] = in.nextInt();
  36.         Lines[2][2] = in.nextInt();
  37.         Lines[2][3] = in.nextInt();
  38.         Lines[3][0] = in.nextInt();
  39.         Lines[3][1] = in.nextInt();
  40.         Lines[3][2] = in.nextInt();
  41.         Lines[3][2] = in.nextInt();
  42.        
  43.    
  44.         for( int uOne = 0; uOne < LineChoice; ++uOne);
  45.             {
  46.                 System.out.println("Please enter number for: Line 1, Number 1: ");
  47.  
  48.  
  49. }
  50. }
Add Comment
Please, Sign In to add comment