Question: Note : Concepts that have not been covered in class cannot be used, for example, arrays, BufferedReader, String methods that have not been introduced, the

Note :

Note : Concepts that have not been covered in class cannot beused, for example, arrays, BufferedReader, String methods that have not been introduced,the use of break (except in switch statements), regular expressions, Systemexitl), arrays,a return in the main method, etc. Do not code loops withforms like while(true). Check with your instructor or TA if you have

Concepts that have not been covered in class cannot be used, for example, arrays, BufferedReader, String methods that have not been introduced, the use of break (except in switch statements), regular expressions, Systemexitl), arrays, a return in the main method, etc. Do not code loops with forms like while(true). Check with your instructor or TA if you have concerns. Use meaningful names for variables; you must follow the camelCase naming standard. Make sure to include a multi-line comment at the top of your code with your name and student number. Format your code so it is easy to read and use comments to provide extra information and detail about your code. Ensure you have followed standard indentation practices - consider using the Auto-layout feature in Blue]. Avoid excessive use of blank lines. Your code must scale to work for any valid input. L0: Intros and Admin L01: Java Intro [video] L02: Literals, Variables, and Data Types [Ex02] L03: Expressions and Scanner [Ex03] L04: String Class and JOptionPane [Ex04] L05: Control Structures: If [Ex05] L06: Control Structures: While [Ex06] L07: Control Structures: For [Ex07] Nested Loops [video] Test 1 [sample] L08: Control Structures: Do while and Switch [Ex08] L09: Intro to Methods [Ex09] L10: Java Class Libraries: Random [Ex10], L11: Character [Ex11] [video] 19-Feb to 26-Feb READING WEEK - NO CLASS L12: Java Class Libraries: Math, Integer 2. (15 marks) Write a program named SlotMachine that simulates playing a slot machine. Possible symbols and winning combinations are as follows: $10000 7 7 7 $5000 7 7 7 $4000 BAR BAR BAR $2000 BAR BAR BAR BAR BAR BAR $1000 BAR BAR BAR BAR BAR BAR $500 BAR BAR BAR ANY ANY ANY 7 7 7 $50 ANY ANY ANY BAR BAR BAR $5Your program will continue to execute a play until it hits a winning combination. Provide a method named getSymbol () that accepts an integer as a parameter and returns the corresponding symbol. Sample output 1: Let's play slots! 1 blue? red? 3bar 2 blue? red? Cherry 3 red? Cherry Cherry 4 bar 3bar 3bar WINNER! Prize: $5 Sample output 2: Let's play slots! 1 blue7 red? cherry 2 blue7 3bar blue? 3 blue7 blue7 3bar 4 red? blue7 red? WINNER! Prize: $50 Sample output 3: Let's play slots! 1 3bar bar Cherry 2 3bar bar red7 3 blue7 blue7 Cherry 4 3bar 3bar red7 5 blue7 2bar cherry 6 red? cherry bar 7 bar blue7 red7 8 2bar 2bar 2bar WINNER! Prize: $1000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!