Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HCI and GUI Second Assignment Notes 2 x images on either side of the group Radio button Progress bar = 5 right guesses and you

HCI and GUI Second Assignment

Notes

2 x images on either side of the group

Radio button

Progress bar = 5 right guesses and you have won

Image user code

Randomised numbers

Stored in an array or a list

Index of the array

Assignment:

HiLo is a card game where a card is dealt and the player has to guess whether the next card that is dealt will be higher or lower than the first card. In the application shown (Figure 1), a card is first dealt on the left hand side. In this case, the card is the King of Clubs. Then, a guess as to whether the next card dealt will be higher or lower is indicated, using the radio buttons in the centre. On clicking the 'Deal Second Card' button, another card is dealt on the right hand side. If the card dealt is in accordance with the guess of the user, then the user wins. Five consecutive, correct guesses constitute an overall game win. A new game is begun using the menu by selecting the 'New Game' item. Note that for the purpose of comparing cards, only the face of the card matters. The suit, i.e, whether Hearts, Spades, Clubs, etc., is unimportant. A second card of equal face value is considered a lose for the purposes of this game.

Create a project called 'CardsHiLoGUI'.

Create a main interface for the application similar to that shown in Figure 1. Remember to create a ToggleGroup for the radio buttons and set the ToggleGroup for each button to ensure mutual exclusivity. At application startup, the card images are populated with default cards. Use comments in your code to explain your approach in relation to the GUI construction. (5 marks)

Add a menu bar and 'File' menu.

The 'File' menu should contain the items 'New Game', 'Shuffle' and 'Exit'. Implement these menu items fully. Add a 'Help' menu with an 'About' item to show your student name and number in a dialog. (5 marks)

Create classes for 'Card' and 'DeckOfCards' to help manage the game.

The Card class should include methods such as 'isEqual( )', 'isLower( )', 'isHigher( )' and 'toString( )'. DeckOfCards should include methods such as 'dealTopCard( )', 'isEmpty( )' and 'shuffle( )'. Provide one or more constructors as appropriate for each class. (5 marks)

(d) Implement dealing of each card, determination of a win/lose and user feedback in a label as shown in Figure 1. Store wins and inform the user of an overall game win on achieving 5 consecutive, correct guesses. (5 marks)

(e) Add a progress bar and progress indicator to indicate progress towards 5 consecutive wins leading to an overall game win. Provide appropriate feedback on achieving an overall game win. Use a stylesheet to apply an attractive look and feel to the application. (5 marks) (Total 25 marks)

Keep a Backup Copy

Ensure that all necessary components are present in the zipped archive. The assignment is submitted electronically. It is extremely important that you keep a backup copy. As a student of Computer Science, you can not easily defend the position that you did not understand the necessity to keep a backup copy.

Sources

In line with good academic practice, you must carefully acknowledge all sources including any material sourced from other students. Unreferenced material pasted from websites or where the source is unclear is of little academic value. As a rough guide, if you include material that takes an alternative approach to that taught in lectures/labs, you must show in your comments that you understand the alternative approach thoroughly. Further, you must fully reference the source(s) of such work so that examiners may assess the value of your contribution. You may be required to explain/present your code in class as part of the work. For that reason it is important that you understand what you present.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions