日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

COMP1721代寫、代做java編程語言

時間:2024-05-02  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



COMP1721 Object-Oriented Programming
Coursework 2
1 Introduction
Your task is to implement a simulation of the card game Baccarat—specifically, the simpler ‘punto banco’
variant of the game. To assist you, we have provided three Java classes: Card ,CardCollection and
CardException. These should form the basis of your solution.
Please note: an absolute requirement of this assignment is that you should not alter the definitions of
the Card, CardCollection andCardExceptionclasses in any way.
2 Preparation
1. Start by learning the rules of the game! Consult the Wikipedia page on Baccarat, which has a very
good summary. Note that you only need to read the sections headed ‘Punto banco’ and ‘Tableau
of drawing rules’.
2. Download the Zip archivecwk2files.zip from Minerva.
3. Unzip the Zip archive. You can do this from the command line in Linux, macOS and WSL 2 with
unzip cwk2files.zip. This will give you a subdirectory named cwk2, containing all the files you
need. Then remove the Zip archive, to ensure that you don’t accidentally submit it as your
solution!
4. Study the files in cwk2. In particular, examine the file README.md, as this provides guidance on how
to run the tests on which your mark will be partly based.
3 Basic Solution
For the basic solution, you must implement these classes:
• BaccaratCard, to represent a single playing card in Baccarat
• BaccaratHand, to represent a hand of cards in Baccarat
• Shoe, to represent the ‘shoe’ from which cards are dealt in Baccarat
You will also need to implement a small program in Baccarat.java that uses the classes.
The files for all of these classes can be found in src/main/java. Your solution MUST be implemented
in these files, in this specific location!
Figure 1 shows the relationships that should exist between the three main classes, and the methods they must
support. Relationships with the other provided classes are not shown.
Before writing any code, think carefully about the best way to reuse the Card and CardCollection
classes that we have provided to you.
Figure 1: Classes needed for Baccarat simulation.
As in Coursework 1, we have provided tests that will help you check whether you have implemented the
classes correctly. Some of the code needed to pass the tests is in the classes we have provided, but you will
1
need to also write stubs for some of the methods in Figure 1 in order for the tests to compile and run—see
the instructions for Coursework 1 if you need a reminder of how to do this.
As in Coursework 1, the tests are run using Gradle:
./gradlew test
Omit the ./ prefix if running in a Windows command shell, or use .\gradlew.bat to invoke Gradle
if running in Windows Powershell. If using IntelliJ, you should also be able to run the tests and other
coursework-related tasks via that IDE’s Gradle tool window.
The following sections provide further details of the requirements for each of the three classes.
3.1 BaccaratCard
These are the minimum requirements for the tests to pass.
• It should be possible to create a BaccaratCard object by specifying a rank and a suit, where the rank
is an instance of the enum Card.Rank and the suit is an instance of the enum Card.Suit .
• It should be possible to query rank and suit via the getRank() and getSuit() methods.
• Calling toString() on a BaccaratCard object should return a two-character string in which the first
character is the rank (A, 2, 3. . .9, T, J ,Q, K) and the second character is the Unicode symbol for the
card’s suit:♣ (\u2663), q (\u2666), r ( \u2665), or ♠ (\u2660).
• It should be possible to compare BaccaratCard objects in two ways, using the equals() and
compareTo() methods. These methods should have the expected behaviour for Java classes, as
discussed in the lectures. They should use rank and suit to perform their comparisons.
• The value() method of BaccaratCard should return the points value of the card in the game of
Baccarat. (See the Wikipedia article for details of scoring.)
Remember that we have provided a Card class to help you with implementation. Some of the requirements above are satisfied by code in that class. Think about the best way of reusing this code.
3.2 BaccaratHand
These are the minimum requirements for the tests to pass.
• A BaccaratHand should be able to store BaccaratCard objects, but it should start out as empty.
• It should be possible to add a BaccaratCardobject to a BaccaratHand by calling the add() method.
• Calling size() on a BaccaratHand should return the number of cards in the hand.
• Calling toString() on a BaccaratHand should return a string containing two-character representations of each card, separated from each other by a space. For example, a hand containing the Ace of
Clubs, Four of Diamonds and Jack of Spades should yield “A♣4q J♠”.
• The value() method of BaccaratHand should return the points value of a hand in the game of
Baccarat. (See the Wikipedia article for details of scoring.)
• The isNatural() method of BaccaratHand should return true if the hand has two cards and a points
value of 8 or 9, false otherwise.
Remember that we have provided a CardCollection class to help you with implementation. Some of
the requirements listed above are satisfied by code in that class. Think about the best way of reusing
this code.
3.3 Shoe
These are the minimum requirements for the tests to pass.
• Shoe must have a constructor in which the number of decks of cards is specified as a parameter. This
can have values of 6 or 8; any other value should result in a CardException being thrown.
• The constructor of Shoe should ensure that a shoe stores the specified number of complete decks of
BaccaratCard objects. A deck of cards is the full set of 52 cards, ordered first by suit and then by
rank. The constructor should not reorder the cards in any way.
2
• Calling size() on a Shoe should return the number of cards in the shoe.
• The shuffle() method of Shoe should reorder the cards in the shoe randomly. Java’s Collections
utility class, from the java.util package, will help you implement this easily. See the documentation
of this class for more details.
• The deal() method of Shoe should remove the first stored card and return it to the caller. Attempting
to deal from an empty shoe should trigger a CardException.
Remember that we have provided aCardCollection class to help you with implementation. Some of
the requirements above are satisfied by code in that class. Think about the best way of reusing this
code.
3.4 Main Program
The final part of the Basic solution is to implement a small program in Baccarat.java that uses the three
classes discussed earlier. This program should
• Create a shoe containing 6 full decks of cards, and shuffle it
• Create hands for the banker and a single player
• Deal a card to player then banker, then repeat this so each hand has two cards
• Display the contents and value of each hand
• Inform the user if the player or banker has a Natural
You can run the program via Gradle, with
./gradlew run
Figure 2 gives an example of the output that the program should generate.
Figure 2: Sample output for the Basic solution.
4 Full Solution
For the Full solution, replace the program in Baccarat.java with a more complete simulation of the game.
Your simulation should follow a simplified version of the ‘punto banco’ rules outlined in the Wikipedia
article. In this version, there is no betting and you should not ‘burn’ any cards from the shoe.
In this more complete simulation, the program will need to play multiple rounds, indicating the result
(Banker win, Player win or Tie) after each round. See the subsections below for further details.
Note: marks for the Full solution will be awarded based on how much of the required behaviour you
are able to implement correctly, and also on how well designed your solution is. A fully object-oriented
implementation in which different aspects of the task are broken out into separate methods will score more
marks than an unstructured implementation where everything is contained within the main method.
4.1 Interactive Mode
If the Baccarat program is run with a single command line argument whose value is either "-i" or
"--interactive" , then it should operate in interactive mode. In this mode, the program should continue
playing the game provided that there are at least six cards remaining in the shoe and the user has indicated
a wish to continue. The program should check this with the user at the end of each round. If the user’s
response does not begin with either 'y' or 'Y' then the game should end.
At the end of the game, the program should display counts of the number of rounds played, the number of
player wins, the number of banker wins and the number of tied rounds. After displaying this information,
the program should terminate.
3
A sample of the expected program output can be seen in Figure 3.Here, the user indicated that they wanted
to finished after playing ten rounds.
Figure 3: Sample output for Full solution (interactive mode).
To test interactive mode using Gradle, do
./gradlew interact
4.2 Non-Interactive Mode
If theBaccarat program is run without command line arguments, it should operate without user interaction,
playing rounds of the game repeatedly until there are fewer than 6 cards remaining in the shoe. At this point,
the program should display the same ‘end of game’ statistics as it does in interactive mode. The program
should then terminate.
Non-interactive mode should be the behaviour seen when running the program with
./gradlew run
5 Submission
Use Gradle to generate a Zip archive containing all the files that need to be submitted:
./gradlew submission
This produces a Zip archive named cwk2.zip. Submit this file to Minerva, via the appropriate link in the
‘Submit My Work’ folder.
The deadline for submissions is 2 pm on 2 May 2024. The standard university penalty of 5% of available
marks per day will apply to late work, unless an extension has been arranged due to genuine extenuating
circumstances.
Note that all submissions will be subject to automated plagiarism checking.
4
6 Marking
20 Tests for main classes (BaccaratCard ,BaccaratHand ,Shoe )
10 Code structure and style for main classes
5 Basic Baccarat program functionality, if Full solution not attempted
15 Full Baccarat program functionality (replaces Basic)
10 Full Baccarat program structure and style
60
Note: there are either 5 marks or 15 marks available for correct functioning of the program that uses the
classes, depending on whether you’ve attempted the Basic solution or the Full solution.You are also assessed
on program structure and style if you attempt the Full solution, but not if you attempt the Basic solution (as
the amount of code required in this case is very small).
Thus the maximum mark that can be achieved for the Basic solution is 36.You can achieve up to 60 marks
if you attempt the Full solution.

 

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機打開當前頁
  • 上一篇:CS 412代做、代寫Python設計程序
  • 下一篇:F27SB代寫、c++,Java程序代做
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        国产人成一区二区三区影院| 亚洲欧美成aⅴ人在线观看| 亚洲黑丝在线| 亚洲国内自拍| 久久精品国产99| 国产视频久久| 久久aⅴ国产紧身牛仔裤| 狠狠爱综合网| 国产一区 二区 三区一级| 欧美视频一区二区三区四区| 国产亚洲亚洲| 亚洲裸体俱乐部裸体舞表演av| 亚洲综合视频1区| 午夜精品久久久久影视| 精品88久久久久88久久久| 精久久久久久久久久久| 欧美日韩中文| 一区二区三区四区五区精品| 亚洲特级毛片| 国产欧美精品日韩区二区麻豆天美| 亚洲黄色性网站| 亚洲电影下载| 国产美女扒开尿口久久久| 在线播放国产一区中文字幕剧情欧美| 美女视频一区免费观看| 久久精品国产亚洲a| 国产日韩在线看片| 国内精品视频在线观看| 国产精品成人在线| 国产三级欧美三级日产三级99| 乱人伦精品视频在线观看| 亚洲性线免费观看视频成熟| 久久久久国色av免费观看性色| 在线看无码的免费网站| 欧美成人激情在线| 蜜桃精品久久久久久久免费影院| 亚欧成人精品| 欧美在线亚洲| 国产美女精品一区二区三区| 亚洲视频一二区| 欧美日韩卡一卡二| 欧美伊人久久大香线蕉综合69| 久久久午夜视频| 国产精品亚洲第一区在线暖暖韩国| 欧美在线高清| 亚洲欧美日本另类| 午夜欧美不卡精品aaaaa| 国产精品乱码妇女bbbb| 欧美一级艳片视频免费观看| 欧美男人的天堂| 欧美freesex8一10精品| 在线视频欧美一区| 久久国产精品亚洲va麻豆| 精品动漫一区二区| 欧美激情成人在线| 国产亚洲成精品久久| 久久综合电影一区| 亚洲日韩视频| 欧美国产日本在线| 性欧美长视频| 亚洲免费高清| 亚洲一区二区视频在线| 免费视频久久| 欧美精品性视频| 亚洲精品在线免费观看视频| 美女被久久久| 欧美激情国产日韩精品一区18| 欧美**字幕| 亚洲一区三区在线观看| 欧美一区二区三区视频免费播放| 国产精品h在线观看| 美女日韩欧美| 亚洲夫妻自拍| 红杏aⅴ成人免费视频| 性欧美激情精品| 亚洲精品老司机| 韩国一区二区在线观看| 国产精品久久久久久影视| 亚洲免费人成在线视频观看| 欧美日韩精品免费| 欧美18av| 亚洲国产成人在线视频| 国产精品毛片a∨一区二区三区|国| 国产精一区二区三区| 久久这里只精品最新地址| 久久久亚洲午夜电影| 一区在线视频| 亚洲欧美精品在线观看| 国产精品福利在线| 久久久久综合| 久久国产精品99国产精| 国产精品久久久久久久浪潮网站| 亚洲嫩草精品久久| 亚洲一区二区三区成人在线视频精品| 久久国产日韩欧美| 国产精品你懂的| 激情六月婷婷综合| 欧美日韩性生活视频| 国产精品久久久久久亚洲毛片| 久热精品视频在线| 亚洲欧美日韩综合一区| 免费日韩精品中文字幕视频在线| 免费观看日韩av| 久久久久久久综合日本| 欧美黄色免费网站| 在线视频亚洲| 日韩一级精品| 国产一区二区欧美日韩| 欧美日韩免费观看一区| 亚洲国产另类久久精品| 久久久久久午夜| 久久久人成影片一区二区三区| 一区二区三区国产在线| 欧美午夜精品一区| 9国产精品视频| 欧美91视频| 欧美女人交a| 一区二区日韩精品| 国产一区二区黄色| 亚洲三级电影全部在线观看高清| 久久伊人亚洲| 欧美激情影院| 欧美一区在线看| 美女视频黄免费的久久| 亚洲欧美成人在线| 一区二区av| 亚洲另类在线视频| 国产一区99| 久久精品免费看| 欧美激情第4页| 亚洲专区一区二区三区| 最新日韩在线| 亚洲欧洲一区二区在线播放| 国产精品久久久久77777| 欧美日韩久久久久久| 欧美国产日韩免费| 亚洲欧洲在线一区| 国产精品夜夜夜一区二区三区尤| 狠狠狠色丁香婷婷综合激情| 久久久久一本一区二区青青蜜月| 欧美成人免费在线视频| 另类尿喷潮videofree| 久久精品国产69国产精品亚洲| 久久精品一本久久99精品| 激情小说另类小说亚洲欧美| 欧美1区2区视频| 日韩一区二区久久| 亚洲第一精品夜夜躁人人躁| 亚洲国产精品尤物yw在线观看| 欧美男人的天堂| 欧美日韩国产经典色站一区二区三区| 黄色成人在线观看| 亚洲日本欧美日韩高观看| 一区二区三区四区精品| 欧美在线看片| 久久久久久一区| 久热成人在线视频| 国产精品一区二区三区四区| 国产麻豆日韩欧美久久| 日韩香蕉视频| 性色av一区二区怡红| 国产精品永久免费视频| 亚洲精选视频免费看| 亚洲欧美日韩一区二区在线|