Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Lot{
- public static void main(String args[]){
- // Initializing
- Scanner in = new Scanner(System.in);
- float PlayerCash = 5;
- // Brief introduction
- System.out.println("=======================================================");
- System.out.println("Welcome to 'Group A' lottery. You have $"+PlayerCash);
- System.out.println("=======================================================");
- 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.");
- // Getting users line choice.
- int LineChoice = in.nextInt();
- if( LineChoice > 4 || LineChoice < 0){
- System.out.println("Sorry but "+LineChoice+" is invalid amount of lines. Please try again.");
- System.exit(0);
- }
- // Creating 2D Array. 4 Columns for users numbers and 4 rows for line choices. 4x4 = 16 cells in total.
- int[][] Lines = new int[4][4];
- Lines[0][0] = in.nextInt();
- Lines[0][1] = in.nextInt();
- Lines[0][2] = in.nextInt();
- Lines[0][3] = in.nextInt();
- Lines[1][0] = in.nextInt();
- Lines[1][1] = in.nextInt();
- Lines[1][2] = in.nextInt();
- Lines[1][3] = in.nextInt();
- Lines[2][0] = in.nextInt();
- Lines[2][1] = in.nextInt();
- Lines[2][2] = in.nextInt();
- Lines[2][3] = in.nextInt();
- Lines[3][0] = in.nextInt();
- Lines[3][1] = in.nextInt();
- Lines[3][2] = in.nextInt();
- Lines[3][2] = in.nextInt();
- for( int uOne = 0; uOne < LineChoice; ++uOne);
- {
- System.out.println("Please enter number for: Line 1, Number 1: ");
- }
- }
Add Comment
Please, Sign In to add comment