博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ITE3101 Introduction to Programming
阅读量:5265 次
发布时间:2019-06-14

本文共 7529 字,大约阅读时间需要 25 分钟。

ITE3101留学生作业代写、代做Java程序作业、代写FRI作业、Java编程作业代做

ITE3101 Introduction to Programming Assignment (2018/19)
Page 1
ITE3101 Introduction to Programming
Programming Assignment Due Date: 7 Dec 2018 (FRI)
Notice to Students
1. This assignment should be written by individual student. All downloaded materials are
not allowed.
2. Plagiarism will be treated seriously. All assignments that have been found involved wholly
or partly in plagiarism (no matter these assignments are from the original authors or from
the 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 your
program.
/********************************************************
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 your
test cases.
6. You are required to hand a zip file containing the following 2 items via the assignment
link in Moodle:
a. A Java Program file (PokerGame.java + PokerGame.class), including detailed
comments
b. A Microsoft Word file (TestResult.doc) stores all screens captured of your test cases
8. Weight of this assignment is 20% of the module total assessment.
ITE3101 Introduction to Programming Assignment (2018/19)
Page 2
Poker Game
Distribution of marks:
30% for Problem solving technique, e.g. algorithms
30% 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 contain
Ace(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 are
Red.
In this game, we design our game rules and score as follow:
Poker Rule Description Score
Straight Flush 5 cards in sequence in the SAME suit 8
Four of a Kind 4 cards of the SAME rank and any other card 7
Full House 3 of a kind and a Pair 6
Flush 5 cards of the SAME suit that are not all in sequence 5
Straight 5 cards in sequence but not all of the same suit 4
Three of a Kind 3 cards of a the same rank and 2 unmatched cards 3
Two Pair 2 sets of 2 cards of a the same rank and an unmatched card 2
One Pair 2 cards of a the same rank and 3 unmatched cards 1
No Pattern is Found! 0
ITE3101 Introduction to Programming Assignment (2018/19)
Page 3
Our final Poker Game interface can be shown as below (for your reference ONLY, you can
design 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 collected
5 cards for each round.
A 2 3 4 5 6 7 8 9 10 J Q K
Clubs (C) 0 1 2 3 4 5 6 7 8 9 10 11 12
Diamonds (D) 13 14 15 16 17 18 19 20 21 22 23 24 25
Hearts (H) 26 27 28 29 30 31 32 33 34 35 36 37 38
Spades (S) 39 40 41 42 43 44 45 46 47 48 49 50 51
humanCards /
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 SK
ITE3101 Introduction to Programming Assignment (2018/19)
Page 4
To 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 10
In order to simplify your main() method, it is suggested to write a set of following methods:
Method Action
void PrintTitle(player); ? Print a title with Player’s name and Computer
heading
For each game round,
void ResetCards(humanCards,
computerCards);
Reset values of both double integer arrays, int[][]
humanCards / computerCards, to 0
void Set5Cards(order, humanCards,
computerCards);
Shuffle the order of 52 playing cards
Distribute the 5 cards to human and computer in
turns
void PrintRoundHeading(current
round);
Print the round number
Print the cards heading for player
Print the cards heading for computer
void Print5CardsInfo(humanCards,
computerCards);
Show the 5 cards that player received and computer
received with some graphic design
String CalculateCards(humanCards /
computerCards);
Refer to the our previous game rules table, consider
the result of the given 5 cards pattern
int CardsScore(humanResult /
computerResult);
Refer to the our previous game rules table, map the
score from the cards result
void PrintRoundResults(humanResult,
current humanScore, computerResult,
current computerScore);
Print the game round results and scores of player
and computer
void PrintSummary(player,
hScoreTotal, cScoreTotal);
After all game rounds, print the winner
Design your own graphic for game is finished
ITE3101 Introduction to Programming Assignment (2018/19)
Page 5
Further 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 Poker
Game:
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”, otherwise
result is “Flush”
If ALL of (isAllClubs, isAllDiamonds, isAllHearts, isAllSpades) are
FALSE,
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 and
result 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”, otherwise
result 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!”

 

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱: 

微信:codinghelp

转载于:https://www.cnblogs.com/wantto/p/10054867.html

你可能感兴趣的文章
第一页 - 工具的使用(webstorm)
查看>>
Linux 进程资源用量监控和按用户设置进程限制
查看>>
IE浏览器整页截屏程序(二)
查看>>
D3.js 之 d3-shap 简介(转)
查看>>
制作满天星空
查看>>
类和结构
查看>>
CSS3选择器(二)之属性选择器
查看>>
adidas crazylight 2018 performance analysis review
查看>>
typeset shell 用法
查看>>
python 之 循环语句
查看>>
心得25--JDK新特性9-泛型1-加深介绍
查看>>
[转]ceph网络通信模块_以monitor模块为例
查看>>
HDOJ 1754 I Hate It(线段树基本操作)
查看>>
latex tree
查看>>
安装NVIDIA驱动时禁用自带nouveau驱动
查看>>
HDU-1255 覆盖的面积 (扫描线)
查看>>
css3学习01
查看>>
【USACO】 奶牛会展
查看>>
ActiveMQ笔记之点对点队列(Point-to-Point)
查看>>
继承和多态
查看>>