Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment2122_v1.docx - Word Arial 16 A A Aa A A IEEE A B I U ab F x x A A A D LAW

imageimageimageimageimage

Assignment2122_v1.docx - Word Arial 16 A A Aa A A IEEE A B I U ab F x x A A A D LAW Cheuk Yin (210165298) AaBbCc AaBbCcD AaBbCcl AaBbCc AaBb( AaBb AaBbC AaBbc AaBbCc AaBbCcl AaBbCcl bExit page 2+ La | 1 * 2 3 Programming (ITP3914) Assignment Assignment Due Date and Time 21 Nov 2021 (Sun) 11:55 pm < .Instructions to Students < page 1+ 1. This assignment is weighted 40% of the overall Continuous Assessment of this module. < 2. This assignment is an individual assignment and should be done by you only. Plagiarism will be treated seriously. Any submitted assignment is found that involved wholly or partly in plagiarism (no matter the assignments are from the original authors or from the plagiarists) will be scored Zero mark and the students involved will be received discipline penalty set by the institute accordingly. < 3. Only Java programming language is allowed to develop any required program. < 4. Your programs must be well structured. A comment should be included in each class and method to state its main function. Explanation of each variable is also required. The source code must be properly indented. The first few lines in a source file must be a comment stating the name of the source file, your name, class, student number as well as the description of the purposes of the program. Marks will be deducted if any of the above mentioned comment is not included. < 5. Grading of your programs will be based on correctness, quality, style, efficiency and the advanced features. < 6. You are required to hand in < o a softcopy of the program source codes uploaded to Moodle. < 7. Remember to backup all your program source codes. < 9. Late submission will NOT be accepted. < 2 < Programming (ITP3914) Assignment Assignment Specification < You are asked to write a BINGO game in Java. < Information on the BINGO < BINGO is a game of chance in which each player matches numbers (from 1 to 25) printed in different arrangements on numbers the game host (caller) draws at random, marking the selected numbers with tiles. When a player finds the selected numbers are arranged on their card in a row, they call out "Bingo!" to alert all participants to a winning card, which prompts the game host (or an associate assisting the host) to examine the card for verification of the win. + 23 22 cards with the < 1 21 20 3 4 19 10 9 5 11 6 17 24 12 65 15 8 13 14 16 18 You can watch the game play on the Youtube: https://youtu.be/ANwuclD0vAo Requirements of the Assignment < The BINGO game will be run in console mode. At the beginning, the program will display two players' cards on the screen. To simplify the program and the test procedure, the arrangement of 25 numbers on the cards are fixed. < 1,9 1367 () : 2 BB 100% Assignment2122_v1.docx - Word X 12 A A Aa A A IEEE A BI Uab A A A Assignment LAW Cheuk Yin (210165298) ~ AaBbCc AaBbCcD AaBbCcl AaBbCc AaBb( AaBb AaBbC AaBbc AaBbCc AaBbCcl AaBbCcl 1 * 2 3 A Programming (ITP3914) Player1's Card: 24 2 8 25 12 16 7 5 6 20 14 23 22 NAGGLO 10 18 11 21 Player2's Card: 15339 24 21 17 15 6 10 3 8 18 20 14 7 16 12 5 25 23 13 19 11 22 49 12 Game Host call (0 to exit): page 3+ A Game Host will input a number to your program. According to the corresponding number on players' cards, your program will mark a "XX" to replace the number. < Game Host call (0 to exit): 16 Player1's Card: 24 2 8 1 25 Programming (ITP3914) Assignment The program should also detect the following input errors: < Game Host call (0 to exit): 26 The number must be between 1 to 25, please call again! Game Host call (0 to exit): -1 The number must be between 1 to 25, please call again! Game Host call (0 to exit): 16 Player1's Card: 24 2 8 1 25 12 XX 7 17 15 55330 5 6 20 19 13 14 23 22 4 3 10 18 11 21 9 Player2's Card: 24 21 17 15 6 10 3 8 18 20 14 7 XX 12 5 25 23 13 19 11 22 4 9 1 2 page 4+ 12 XX 7 17 15 5 6 20 19 13 14 23 22 43 10 18 11 21 9 Player2's Card: 24 21 17 15 6 20 10 3 8 18 14 7 XX 12 5 25 23 13 19 11 22 49 1 2 Game Host call (0 to exit): The program will show who is the winner if a player wins, and then end the game. < Game Host call (0 to exit): 23 Player1's Card: 24 XX 8 1 12 XX 7 17 15 5 XX XX 22339 19 13 4 14 XX XX XX XX 11 21 Player2's Card: 24 21 17 15 XX XX 38 XX XX 14 7 XX 12 5 25 XX 13 19 11 XX 4 9 1 XX Player1 Bingo! Player2 Bingo! 3,9 1367 () : Game Host call (0 to exit): 16 The number 16 is repeated, please call again! Game Host call (0 to exit): Furthermore, your program MUST allows Game Host to input 0 to quit the game. < ] BB Q | 90% Assignment2122_v1.docx - Word H M W & 12 - ' ' Aav AoA A BI Uab x, x Av DA A == ITP3914 Programming Assignment Testing Method LAW Cheuk Yin (210165298) AaBbCc AaBbCcD AaBbCcl AaBbCc AaBb( AaBb AaBbC AaBbc AaBbCc AaBbCcl AaBbCcl 1 * 2 3 A 2021/22+ ITP3914 Programming Assignment 2021/22+ 10 18 11 21 9 Player2's Card: You can ease the testing by using 'Copy and Paste' rather than inputting data manually. Prepare a text file, which includes all user inputs in a game run. The following input is an example. < < By using Copy and Paste, you can automatically input in the command prompt window and then get the result automatically (without the input data echoed). < 24 23 8 18 14 7 XX 12 25 23 13 19 22 4 9 1 6+ Game Host call (0 to exit): Player1's Card: 24 2 8 12 XX 7 125 < Test Case 28 -2 16 10 10 22 64 20 18 2 23 + Expected Outpute Playerl's Card:+ 24 2 8 12 16 7 17 15 5 6 20 19 14 23 22 4 3 10 18 11 21 9 Player2's Card:+ 24 21 17 10 3 8 18 20- 14 7 16 12 25 23 13 11 22 4 9 2 Game Host call (0 to exit): 28 -24 16 10 10 22 20 18 2 23 5 6 20 14 23 22 4 XX 18 11 21 Player2's Card: 9 24 21 17 15 6 XX 3 8 18 20 14 7 XX 12 5+ 25 23 13 19 22 9 1 2 Game Host call (0 to exit): The number 10 is repeated, please call again! Game Host call (0 to exit): Player1's Card: < 24 2 1 25 12 XX 7 15- 14 23 XX 18 11 21 Player2's Card:+ 24 21 17 15 XX 3 8 18 20 14 7 XX 12 23 19 a 'go 5 6 20 19 13 4 3 9- 1 Game Host call (0 to exit): Player1's Card: 24 1 25 12 XX 7 17 15 5 XX 14 23 19 4 XX 18 11 21 Player2's Card:+ |: 24 21 17 15 XX XX 3 8 18 20 14 7 XX 12 25 23 XX 4 19 1 2 Game Host call (0 to exit): Playerl's Card:+ The number must be between 1 to 25, please call again! Game Host call (0 to exit): The number must be between 1 to 25, please call again! Game Host call (0 to exit): Player1's Card: 24 2 8 24 2 8 1 25 12 XX 7 17 15 5 XX XX 19 14 23 XX 4 12 XX 7 6 20 14 23 22 4 3 5,9 1367 () : Page 5 of 9+ XX 18 11 21 31 Player2's Card: 24 21 17 15 XX- | Page 6 of 9+ BB 90% Assignment2122_v1.docx - Word X v 12 ' ' Aa A A BIU ab x, x A A A === ITP3914 Programming XX 3 8 18 14 12 t 25 23 13 11 - XX 4 9 1 Game Host call (0 to exit): ( < Playerl's Card: () 24 2 8 12 XX 7 17 15 (1 5 XX XX 14 23 XX XX 11 21 Player2's Card: () 24 21 17 15 XX XX 4 19 13 # 31 9- XX 3 8 XX XX 14 7 XX 12 5 1 25 23 13 19 11 - 9 1 Game Host call (0 to exit): (H Playerl's Card:() 24x 8 12 XX 7 5 XX XX 19 13 # 14 23 XX 3 XX XX 11 9 Player2's Card: () 24 21 17 XX 3 8 XX 25 23 13 19 XX XX 4 9 1 XX Game Host call (0 to exit): + Playerl's Card: () 24 XX 12 XX 7 17 5 XX XX 19 13 1 14 XX XX 4 XX XX 11 3 # 9 Player2's Card:() 24 21 17 15 XX 3 8 XX XX + 14 7 XX 12 5 1 25 XX 13 19 XX 4 9 1 Playerl Bingo!) Player2 Bingo!! e 11 - XX < ttt1 7,9 1367 () : Assignment LAW Cheuk Yin (210165298) AaBbCc AaBbCcD AaBbCcl AaBbCc AaBb( AaBb AaBbC AaBbc AaBbCc AaBbCcl AaBbCcl 1 2 3 ~ A | 2021/22+ ITP3914 Programming Assignment Requirement for Scanner usage Wrong Scanner usage: < // create new Scanner objects in loope do {H Scanner sc = new Scanner( System.in); choice = sc.nextInt(); } while (choice_!= 1); < 2021/22 You are NOT allowed to use GUI such as JOptionPane in your program. < Following is an example program to use import java.util.Scanner; < public class Test {' //Global declaration for Scannere Global Scanner to do the input. < public static Scanner sc = new Scanner(System.in);/ public static void main(String args[]) { < } int xye System.out.print("Enter x:");\ x = sc.nextInt();) public static void method2 () {' int Vi System.out.print ("Enter y:"); < y = sc.nextInt();/ + ] 90% Assignment2122_v1.docx - Word X Arial 12 ~AA Aa A+ A B I Uab x, x ADA A 9,9 1367 () : LAW Cheuk Yin (210165298) ~ AaBbCc AaBbCcD AaBbCcl AaBbCc AaBb( AaBb AaBb( AaBbc AaBbCc AaBbCcl AaBbCcl 1 2 3 ITP3914 Programming Marking Scheme 20 marks (e + Assignment 2021/22+ Correctly draw the players' card with marked numbers according to Game Host's input. (-) 20 marks(e Your program will detect two kinds of errors: < Game Host input error: input number is not within 0 to 25. Game Host input error: input duplicated number. < Game Host input 0 to quit the game. < 40 marks e Correct program logic - determine winner and then end game. < 10 marks (e Use good program structure (indentation), appropriate methods and meaningful variables' names. < 10 marks e Documentation (Comments). < : Deductione Cannot pass the Java compiler -100 < Do not follow the requirement and corresponding output in "Testing Method" -30- More than one Scanner objects in your codes -20 Do not use Scanner as the one and only one input method in your codes -50 Cannot perform a demonstration to your lecturer -50( | 90%

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

Step: 1

import javautilRandom public class Main public static void mainString args int number1 10 30 45 66 8... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions