Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with my JAVA assognment, please read the demand carefully. Use java to creat a connect 4 game. use three classes as blow, please

Need help with my JAVA assognment, please read the demand carefully.

Use java to creat a connect 4 game.

use three classes as blow, please use inherit, super in those classes.

image text in transcribed

Please let the output similar than the sample out pu below.

Welcome to Connect 4. Please enter your names. Player 1 name: Bob Player 2 name: Jane Bob - you have red chips "R" and you go first. 1 2 3 4 5 6 7 1 2 3 4 5 6 Please input a column# between 1-7: 1 1 2 3 4 5 6 7 1 2 3 4 5 6 R Jane - you have yellow chips "Y" and you go next. Please input a column# between 1-7: 1 1 2 3 4 5 6 7 1 2 3 4 5 Y 6 R RED Please input a column# between 1-7: 4 1 2 3 4 5 6 7 1 2 3 4 5 Y 6 R R YELLOW Please input a column# between 1-7: 3 1 2 3 4 5 6 7 1 2 3 4 5 Y 6 R Y R RED Please input a column# between 1-7: 4 1 2 3 4 5 6 7 1 2 3 4 5 Y R 6 R Y R YELLOW Please input a column# between 1-7: 2 1 2 3 4 5 6 7 1 2 3 4 5 Y R 6 R Y Y R RED Please input a column# between 1-7: 4 1 2 3 4 5 6 7 1 2 3 4 R 5 Y R 6 R Y Y R YELLOW Please input a column# between 1-7: 2 1 2 3 4 5 6 7 1 2 3 4 R 5 Y Y R 6 R Y Y R RED Please input a column# between 1-7: 4 1 2 3 4 5 6 7 1 2 3 R 4 R 5 Y Y R 6 R Y Y R RED Connect 4! Congratulations

Chip -colour: String +Chip (c:String): get/set inethods for all the attributes +equals (c: Chip): boolean + toString O : String Board rows : int cols: int boardDI: Chip Board (r: int,e :int) +Board (r: int, c: int): + get methods for all the attributes + isEmpty (r: int, c: int) : boolean + add (r: int, c: int, chip : Chip): boolean Connect4Board + Connect4Board ): +add (c:int, colour: String): boolean + winType ): String +winner (): boolean +toString):String

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_2

Step: 3

blur-text-image_3

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

Students also viewed these Databases questions

Question

Why are red blood cells Red in colour?

Answered: 1 week ago

Question

Define Consumerism.

Answered: 1 week ago

Question

Name the system that includes heart, blood vessels and blood?

Answered: 1 week ago