Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Battleship java code

28/03/2021 Client: saad24vbs Deadline: 2 Day

University of Central Florida

COP 3330 Object Oriented Programming
Spring 2017
2

Assignment 3

Due, Wednesday, April 12, 2017 for 100% credit

Thursday, April 13, 2017 for 90% credit

Friday, April 14, 2017 for 80% credit

Saturday, April 15, 2017 for 70% credit

Deliverables

To complete this assignment you must submit your compressed Netbeans project to Webcourses. This requires you to submit a .zip, .rar, .tar, .tgz. etc… of the ENTIRE project. Individual source code files will not be accepted.

Introduction

This assignment is to develop a User Interface using classes from the javax.swing package.

Tasks and Rubric

Activity

userInterface package

BattleshipUI.java

Add an import for

1. core.BattleshipClient

2. core.Ship

Create an ActionListener for the Deploy Ships button that does the following:

1. Disables the UI components on the JPanel with ship selection options

2. Add a JPanel to the right of Player One’s button board with a JTextArea for displaying the game status to the user

3. Add a JPanel to the right of the game status with Player Two’s button board

4. Call the play() method in class BattleshipClient

In the ActionListener for the Game Menu set the player mode based on what the user selected, the options are:

Player versus Player

Player versus Computer

Computer versus Computer

Example code:

if(e.getActionCommand().equals("Player vs. Player"))

{ players[Constants.PLAYER_ONE].setPlayMode(Constants.HUMAN); players[Constants.PLAYER_TWO].setPlayMode(Constants.HUMAN);

}

Player.java

Add a class member to store the player’s mode, human or computer; create getter/setter for the class member

Create a method that will automatically layout the ships for when the player mode is set to computer using the Random class to randomly select the direction and location for the startRowClick and startColumnClick; make sure the auto layout uses null for the color

PlayerOptionDialog.java

Update the UI so that it reflects the saved data for each Player

core package

BattleshipClient.java

This class controls the game being played

Create a custom constructor that takes two parameters, an Array of class Player and class BattleshipUI

Create a method play() to manage the play between Player One and Player Two; for this iteration only Human versus Computer has to function

When a JButton has been selected/clicked:

1. if it is a hit

a. change the background color to something other than the default gray(i.e. null) and the ship color (e.g.Color.BLACK)

b. update the object instance so that the number of hits is increased or the hits left is decreased

2. if it is a miss

a. change the background color to something other than the default gray (i.e. null), the ship color, or the color used for a hit

When a ship has 0 (zero) hits left or has taken the max number of hits update the ship so that isSunk = true; notify the user when each of their ships has been sunk

Whichever player sinks all five opponent’s ships first wins the game!

functionality

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Phd Writer
Top Grade Tutor
Supreme Essay Writer
Finance Master
Isabella K.
Write My Coursework
Writer Writer Name Offer Chat
Phd Writer

ONLINE

Phd Writer

Hello, I an ranked top 10 freelancers in academic and contents writing. I can write and updated your personal statement with great quality and free of plagiarism

$41 Chat With Writer
Top Grade Tutor

ONLINE

Top Grade Tutor

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$21 Chat With Writer
Supreme Essay Writer

ONLINE

Supreme Essay Writer

Give me a chance, i will do this with my best efforts

$35 Chat With Writer
Finance Master

ONLINE

Finance Master

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$48 Chat With Writer
Isabella K.

ONLINE

Isabella K.

Give me a chance, i will do this with my best efforts

$47 Chat With Writer
Write My Coursework

ONLINE

Write My Coursework

Give me a chance, i will do this with my best efforts

$19 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Cqu harvard - Bending stress in a beam formula - Rachel stassen berger bio - Discussion post - Correct patient correct site correct procedure - A nurse is providing preoperative teaching - My many colored days lesson - Health promotion project plan template - Because life events __________, they cannot be the single cause of midlife change. - 1.120 461 in spanish - Interdependency between various segments of the hospitality industry means - Why didn t dexter want a pocket calculator - 2 3 4 dimethoxybenzylidene indan 1 one - Audit of the acquisition and payment cycle - The key operating question of moral management is - Interstate battery date code - Late submission penalty cqu - Introduction paper - Human Resource (tutorjass) - Financial Accounting Cengage Assignment 11 -Homework - Stephanie buttermore jeff nippard - 1696 riverway drive kelso - Https www learner org courses envsci interactives demographics - Data analytics and datamining - Tord gustavsen trio tour - Bbc schools science clips characteristics of materials - Araceli mendoza alvarez released - Human resources in healthcare managing for success pdf - According to the ajzen model, the strongest predictor of an employee’s behavior is (are) - Romeo and juliet final test - BLACK OUT SUMMER 1977 - Probability and statistics homework help - An ad campaign for a new snack chip - English is a crazy language article - Master gunners cottage mosman - Henna co forecasted contribution margin income statement - Equal employment opportunity laws - Assignment108312020 - Edwina the emu activities - Video - Team contract example - Divine chocolate case study - Practical connection assignment - Acct 505 week 8 final exam - Commercial property valuation pdf - Coll Bargain 4.2 - Amznmktplace on bank statement - Bottle green squeezy squash - What is straight numeric filing system - The following represents a project that should be scheduled using cpm - Nissan cause and effect diagram - 7 p's neurovascular assessment - Need the following 1. Reflection & Discussion post 2. Short essays - How much per page / 275 words, i have couple of papers to work - +91-8890675453 love marriage problem solution IN Kakada - Investment Strategy and Products - Sadie and maud questions and answers - Parris in the crucible - Which group determines a product's position relative - 2039 spr cnbc springfield mo - Cisco downloadable acl example - Children's thinking siegler 4th edition pdf - The rainbow fish genre - Www pigeon craic com auctions - Mini Case Analysis 1000 words - 4 oz to 1 gallon ratio - What is rhythm in poetry - Finance project needed - Leslie marmon silko lullaby pdf - How will you know when your titration is finished - Orix rentec malaysia sdn bhd - Encoding and decoding in excel - Janis 1972 victims of groupthink - Gaia cs umass edu wireshark labs - Andalusians for sale in california - Cushenberry corporation had the following transactions. - Basketball foul hand signals - 19.3 adjective clauses practice 1 answers - 0.00004 in standard form - Myob annual leave report - Global business today chapter 1 - Separating iron filings salt and sand - Yanmar pressure washer manual - Introduction to java programming pdf notes - Swivel packing top drive - Mike rose blue collar brilliance - ECOM402 - Magic whiteboard dragons den - I am looking for someone to complete my International Organizational Behavor - Response - Quantitative measures of a company's competitive strength - The story of an hour third person omniscient - Astronomy alive bentleigh vic - Mass communication living in a media world sixth edition pdf - Java program for rolling two dice - S ut 1 2at 2 solve for u - Political Science 101 - How many o atoms are in 4.39 g of co2 - 5 pages essay---xiaoyazi - Port arthur isd pay scale