ITE3101留学生作业代写、代做Java程序作业、代写FRI作业、Java编程作业代做
ITE3101 Introduction to Programming Assignment (2018/19)Page 1ITE3101 Introduction to ProgrammingProgramming Assignment Due Date: 7 Dec 2018 (FRI)Notice to Students1. This assignment should be written by individual student. All downloaded materials arenot allowed.2. Plagiarism will be treated seriously. All assignments that have been found involved whollyor partly in plagiarism (no matter these assignments are from the original authors or fromthe plagiarists) will score ZERO marks.3. Your program must use Java JDK1.8 or above to develop.4. Your program must be structured and well commented. The first few lines in the source file must be comments stating the name of the source file,student name, student ID, course name, course code, and brief description of yourprogram. /******************************************************** Name of Source File: PokerGame.java Student Name (ID): Chan Tai Man (183456789) Course Name (Code): HD in GA (IT114206) Program Description: This program is . . . . . . . . . . . . . . . . . ********************************************************/Marks will be deducted if such comments are not included.5. Write?down your test cases and the reason(s) for them. Test your program by using yourtest cases.6. You are required to hand a zip file containing the following 2 items via the assignmentlink in Moodle: a. A Java Program file (PokerGame.java + PokerGame.class), including detailedcomments b. A Microsoft Word file (TestResult.doc) stores all screens captured of your test cases8. Weight of this assignment is 20% of the module total assessment. ITE3101 Introduction to Programming Assignment (2018/19)Page 2Poker GameDistribution of marks:30% for Problem solving technique, e.g. algorithms30% for Java programming technique, e.g. statements, control structures, etc.20% for good program styles, e.g. naming, comments, etc.20% for the evidence of Testing, e.g. test case, test result, etc.Problem Specification:You are asked to develop a Java Program that designs a simple Poker game.A standard deck of cards has 52 cards. Each card has a value and a suit. Values containAce(A), 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack(J), Queen(Q), and King(K). The four suits are Clubs,Diamonds, Hearts and Spades. Clubs and Spades are Black, while Diamonds and Hearts areRed.In this game, we design our game rules and score as follow:Poker Rule Description ScoreStraight Flush 5 cards in sequence in the SAME suit 8Four of a Kind 4 cards of the SAME rank and any other card 7Full House 3 of a kind and a Pair 6Flush 5 cards of the SAME suit that are not all in sequence 5Straight 5 cards in sequence but not all of the same suit 4Three of a Kind 3 cards of a the same rank and 2 unmatched cards 3Two Pair 2 sets of 2 cards of a the same rank and an unmatched card 2One Pair 2 cards of a the same rank and 3 unmatched cards 1No Pattern is Found! 0ITE3101 Introduction to Programming Assignment (2018/19)Page 3Our final Poker Game interface can be shown as below (for your reference ONLY, you candesign your own game interface):Refer to the previous diagram, Example set of 52 playing cards, you may construct an integer array, int[] order, to shuffle the order of 52 cards, and two double integer arrays, int[][] humanCards / computerCards, to store the collected5 cards for each round. A 2 3 4 5 6 7 8 9 10 J Q KClubs (C) 0 1 2 3 4 5 6 7 8 9 10 11 12Diamonds (D) 13 14 15 16 17 18 19 20 21 22 23 24 25Hearts (H) 26 27 28 29 30 31 32 33 34 35 36 37 38Spades (S) 39 40 41 42 43 44 45 46 47 48 49 50 51humanCards /computerCards[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12][0] CA C2 C3 C4 C5 C6 C7 C8 C9 CT CJ CQ CK[1] DA D2 D3 D4 D5 D6 D7 D8 D9 DT DJ DQ DK[2] HA H2 H3 H4 H5 H6 H7 H8 H9 HT HJ HQ HK[3] SA S2 S3 S4 S5 S6 S7 S8 S9 ST SJ SQ SKITE3101 Introduction to Programming Assignment (2018/19)Page 4To build your simple Poker Game program, you may consider the following:Prompt for the Player Name and check for the proper Game Rounds Player Name supports ANY strings input Game Rounds only supports integer input between 2 to 10In order to simplify your main() method, it is suggested to write a set of following methods:Method Actionvoid PrintTitle(player); ? Print a title with Player’s name and ComputerheadingFor each game round,void ResetCards(humanCards,computerCards); Reset values of both double integer arrays, int[][]humanCards / computerCards, to 0void Set5Cards(order, humanCards,computerCards); Shuffle the order of 52 playing cards Distribute the 5 cards to human and computer inturnsvoid PrintRoundHeading(currentround); Print the round number Print the cards heading for player Print the cards heading for computervoid Print5CardsInfo(humanCards,computerCards); Show the 5 cards that player received and computerreceived with some graphic designString CalculateCards(humanCards /computerCards); Refer to the our previous game rules table, considerthe result of the given 5 cards patternint CardsScore(humanResult /computerResult); Refer to the our previous game rules table, map thescore from the cards resultvoid PrintRoundResults(humanResult,current humanScore, computerResult,current computerScore); Print the game round results and scores of playerand computervoid PrintSummary(player,hScoreTotal, cScoreTotal); After all game rounds, print the winner Design your own graphic for game is finishedITE3101 Introduction to Programming Assignment (2018/19)Page 5Further Analysis and Extra Helping:To shuffle the order of 52 playing cards, it is suggested to write a method, public static int[]ShuffleCards() To build an integer ArrayList with code:List<Integer> cardOrderList = new ArrayList<Integer>(); To random the 52 orders, using the code:Collections.shuffle(cardOrderList); Now the ArrayList is replaced by an integer array with code pattern:Iterator<Integer> iterator = cardOrderList.iterator();... ...... ... iterator.next().intValue();The method, public static String CalculateCards(int[][] cards), is the heart of this PokerGame: Set 4 Boolean variables, isAllClubs, isAllDiamonds, isAllHearts, isAllSpades Set Boolean variables, isOneDiff, isPairFound, isThreeKind (for checking cards pattern)o if the first rowTotal of cards = 5, isAllClubs = true;o if the second rowTotal of cards = 5, isAllDiamonds = true;o if the third rowTotal of cards = 5, isAllHearts = true;o if the four rowTotal of cards = 5, isAllSpades = true; If either one of (isAllClubs, isAllDiamonds, isAllHearts, isAllSpades)is TRUE,o Check the 5 card’s positions are adjacent and result is “Straight Flush”, otherwiseresult is “Flush” If ALL of (isAllClubs, isAllDiamonds, isAllHearts, isAllSpades) areFALSE,o If ANY column total of cards are >=2, break;o If the column total of cards is <2, check if the 5 card’s positions are adjacent andresult is “Straight” If a column total of cards = 4, result is “Four of a Kind” If a column total of cards = 3, isThreeKind = true; If a column total of cards = 2, isPairFound = true;o If another (isPairFound) is found, result is “Two Pair” If both (isThreeKind, isPairFound) are TRUE, result is “Full House”, otherwiseresult is “Three of a Kind”http://www.6daixie.com/contents/9/2278.html If only one (isPairFound) is TRUE, result is “One Pair” If NONE of the above, then “No Pattern is Found!”
因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:
微信:codinghelp