讲解:Java:IAPP001 PayDay GUIJava

用Java代写一个选择题的答题器程序,练习基本的程序设计。SpecificationBuild a GUI for a PayDay application. The domain or model tasks are described in Appendix A. The situations to be handled are listed in Appendix B.The basic form of the GUI is a single window multiple panels. The general appearance and behaviour of the panels are described below; for more details about the system behaviour, see the task descriptions. As a general principle, your GUI should provide some form of feedback for every button press; the user should never have to guess whether the command succeeded or not. Assume that no typing errors are made; a user may enter an incorrect value such as a wrong session id, but that is not a typing error.Main WindowThe main window has two panels: the board panel the control panel:The board panel handles the player icons’ movement around the PayDay board - no changes are required for this panel.The control panel has 2 panels: the roll panel the boss panel:The roll panel displays the jackpot amount and the dice rolls for the player and computer. The user clicks on the Play button to start a game.The boss panel has 2 panels: the display panel the system panel:The display panel displays balances for the computer and player. The user clicks on the Change Player Name button and to change the player’s name. The system will display a separate window to allow the user to change a player’s name.The system panel has 3 buttons, List Bills, Exit and Show. Exit closes the application, show calls game.show() for debugging purposes.List Bill Window - HD taskThe list of bills owed by each player are displayed in a separate window, including the amount and description.The skeleton provides no code for this task. Changes will need to be made to the model for this task. This task is very difficult, do not attempt it until the base assignment has been completed.ImplementationSkeleton code for the system can be downloaded from UTSOnline. Use the MVC and Observer code patterns where appropriate. The GUI classes must be in a separate package from the model classes, as in the skeleton code.Appendix A: Domain task descriptionsMini PayDay is a small simplified version of the board game PayDay. The board has 14 squares, 3 Chance squares (Sweepstakes, Lottery Casino), 3 Mail squares, 4 Expense squares (Pay Rent, Fun Day, Buy Groceries Pay School Fees), 2 Income Squares (Receive Dividend Income Tax Rebate), a generic Square (Rest Day) and a PayDay square.Here is the layout of the board:There are 2 players; a manual player and the computer, each player starts with $1000 and rolls the dice moving from left to right, top to bottom.Every time a player passes or lands on PayDay, they receive wages of $1000, pay any bills and pay interest on loans (at 10%). A player can take out loans in increments of $1000, if they do not have enough money. A player can pay off loans in increments of $1000, if they have enough money.When a Player lands on a Chance square (SweepStakes, Lottery Casino), the Player rolls the dice:SweepStakes - the player wins $100* the dice rollLottery - the player wins $20*the dice rollCasino - thiJava代写:IAPP001 PayDay GUI代写Java课程设计s is a special type of Chance square - the player rolls the dice, if the dice roll is odd the player wins $500. If the dice roll is even, the player loses $500 (the amount is placed in the jackpot kitty).When a player lands on a Mail square, the system randomly picks a MailCard;There are 5 possible MailCards:Bill - Land rates bill due $2500Ad - Get 20% off FoxtelBill - Telephone bill due $1200PostCard - Nanna is having fun in GreeceBill - Electricity bill due $ 900If the Player receives a Bill, the bill is held and needs to be paid on PayDay. Any other MailCard is considered junk mail and is discarded.When a Player lands on an Expense Square (Pay Rent, Fun Day, Buy Groceries Pay School Fees), the player must pay the expense amount immediately.Pay Rent - the player pays $600Fun Day - the player pays $200Buy Groceries - the player pays $300Pay School Fees - the player pays $500The amount paid by the player is placed in the jackpot kitty.When a player lands on an Income Square (Receive Dividend Income Tax Rebate), the player receives the income amount.Receive Dividend - the player receives $400Income Tax Rebate - the player receives $200When a player lands on Rest Day (the generic Square), no action is taken.When a player lands on the PayDay square, the player receive wages of $1000, pays any bills accumulated in the pay period (the bills are then discarded) and pays interest on any loans.If the player does not have enough money, they must take out a loan (in increments of $1000).If a Player has enough money, they must payoff any loans (in increments of $1000).The player then moves to the Start position (position 0).The game ends after 2 rounds have been played.The tasks are described below; in each task description, the success or normal case is described first, then any special or error cases.Add PlayerA user must enter a name for the manual player. The player balance, loan amount and the board position of the player are held by the system.PlayThe dice is rolled and the player moves the designated number of spaces to the new space. Any required action is executed; any penalty or bonus is applied to the player’s balance and/or the jackpot balance.JackpotIf the player rolls a 6, they win the amount of money accumulated in the jackpot.The jackpot amount is reset to 0. Jackpot is not won if player rolls a 6 on a Chance roll.List Bills - HD TaskFrom time to time, the players want to know what bills they will need to pay on PayDay, and what bills the other players need to pay.Appendix B: Situations to handleChange Player Name.The system shows label changes on Control panel Display panelPlayWin JackpotPass PayDayGame OverCorrect balancesList BillsCorrect order and layoutAppendix C: Example GUI LayoutPlease note: In this layout I used confirm.setPreferredSize(new Dimension(400, 100)); to set the size of JTextArea confirm, otherwise the text area will resize with the text displayed.转自:http://ass.3daixie.com/2019012364640154.html

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容