Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java program 1. Create a class Qwirkle with two attributes: colour and shape. 2. The digits 1-6 are used to represent the colours of the

Java program

1. Create a class Qwirkle with two attributes: colour and shape. 2. The digits 1-6 are used to represent the colours of the tile (Red, Green, Blue, Yellow, Orange, Pink). 3. The digits 1-4 are used to represent the shape of the tile (Square, rectangle, oval, triangle). 4. Each object of the class Qwirkle represents one tile to be used in the game. 5. Define a constructor to create object of class Qwirkle with random shape and colour. 6. Define a method to compare two tiles for equality. If a randomly generated Qwirkle object has shape and colour same as an existing tile, generate a new tile. Qwirkle object 1 has colour=green and shape=rectangle Qwirkle object 2 has colour=green and shape=rectangle Then generate new random shape and colour for object 2. 7. Save the class as Qwirkle.java 8. Create a main class QwirklePlay.java. 9. Player 1 picks 3 tiles with random values for colour and shapes. 10. Player 2 picks 3 tiles with random values for colour and shapes. 11. Tiles of player 1 should be unique. 12. Tiles of player 2 should be unique. 13. For player 1 Increment score equal to same-coloured (but unique) tiles. 14. For player 1Increment score equal to same-shaped (but unique) tiles. 15. For player 2 Increment score equal to same-coloured (but unique) tiles. 16. For player 2 Increment score equal to same-shaped (but unique) tiles 17. Display colour and shape of all the tiles of Player 1. 18. Display colour and shape of all the tiles of Player 2. 19. Player with higher score wins. Display Tie if score of both the players is same.

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

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

In Problem find f (x) and simplify. f(x) = 5x2(x3 + 2)

Answered: 1 week ago

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago

Question

Find dy/dx if x = te, y = 2t2 +1

Answered: 1 week ago

Question

6. Be able to choose and prepare a training site.

Answered: 1 week ago