Placeholder

CSIS 111 Module Week 8 ASSIGNMENT BATTLE SHIP GAME

$19.00

Description

Imagine you are using a two-dimensional array as the basis for creating the game battle- ship. In the game of battleship a `~’ character entry in the array represents ocean (i.e., not a ship), a `#’ character represents a place in the ocean where part of a ship is present, and a `H’ character represents a place in the ocean where part of a ship is present and has been hit by a torpedo. Thus, a ship with all `H’ characters means the ship has been sunk.
Declare a two-dimensional array that is 25 x 25 that represents the entire ocean and an If statement that prints “HIT” if a torpedo hits a ship given the coordinates X and Y.
Create a text file of 25 line. Each line has 25 characters. ~ represents water and # represents part of a ship. This file is the battleship game board. An example file might look like:
Then write a C++ program that will read in the file representing the game board with 25 lines where each line has 25 characters corresponding to the description above.
You must write a function called Fire() that will take an X and Y coordinate and print “HIT” if a ship is hit and “MISS” if a ship is missed. If a ship is HIT you must update the array with an `H’ character to indicate the ship was hit. If a ship is hit that has already been hit at that location you must print “HIT AGAIN”. You must write a second function called FleetSunk() that will determine if all the ships have been sunk.
Your C++ program must then call these functions until all the ships have been sunk at which point the program should display “The fleet was destroyed!” When the fleet has been sunk, end by printing to the screen your game array showing all HITS and MISSES.
Submit C++ Programming Assignment 8 by 11:59 p.m. (ET) on Friday of Module/Week 8.
SCREENSHOTS
SOLUTION
PAYMENT
CSIS 111 Week 8
CSIS 111 Assignment 8
CSIS 111 BATTLE SHIP GAME
The solution includes Visual Studio project, report, screenshots.
Attachments [Move over files to preview content of those files]
CSIS_111_Week_8.zip (19.98 MB)
CSIS111-Week-8-Screenshot-1.png
CSIS111-Week-8-Screenshot-2.png
CSIS111-Week-8-Screenshot-3.png
Firstname_Lastname_Assignment8_Report.docx
Visual Studio Project
CSIS111Assignment8
.vs
CSIS111Assignment8
v16
.suo
Browse.VC.db
ipch
AutoPCH
435b0757318a12bb
ASSIGNMENT8.ipch
50006b81510f7bbb
ASSIGNMENT8.ipch
CSIS111Assignment8
Assignment8.cpp
board.txt
CSIS111Assignment8.vcxproj
CSIS111Assignment8.vcxproj.filters
CSIS111Assignment8.vcxproj.user
Debug
Assignment8.obj
CSIS111A.1bea61e6.tlog
CSIS111Assignment8.lastbuildstate
CSIS111Assignment8.exe.recipe
CSIS111Assignment8.ilk
vc142.idb
vc142.pdb
CSIS111Assignment8.sln
Debug
CSIS111Assignment8.exe
CSIS111Assignment8.pdb
Preview Assignment8.cpp
xxxx xxxxxxxxxx(xxxx xxxxx[][25]);
xxxx xxxx(xxxx xxxxx[][25], xxx &x, xxx &x, xxx &xxx);
xxxx xxxxxxxxx(xxxx xxxxx[][25], xxx &xx);
xxx xxxx()
{
//In cout statement below SUBSTITUTE your name and lab number cout << "Firstname Lastname -- Assignment #8" << endl << endl; //Variable declarations int missCount = 0; int hitCount = 0; int xMiss[25 * 25 + 1]; int yMiss[25 * 25 + 1]; int xHit[25 * 25 + 1]; int yHit[25 * 25 + 1]; char board[25][25]; int x, y, hit; int fs = 0; xxxx x; xxxxxx x; //xxxxxxx xxxxx xxxxxxxx xxxxx; xxxxx.xxxx("xxxxx.xxx"); xxx (xxx x = 0; x < 25; x++) { Preview board.txt ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~#####~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~#~~~~~~~~~ ~~~~~~~~~~~~~~~#~~~~~~~~~ ~~~~~~~~~~~~~~~#~~~~~~~~~ ~~~~~~~~~~~~~~~#~~~~~~~~~ ~~~~~~~~~~~~~~~#~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~#####~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~#####~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~#####~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~#~~~~~~ ~~~~~~~~~~~~~~~~~~#~~~~~~ Price: $19 Buy Now Checkout Added to cart Add to Cart Checkout Added to cart You May Also Like: CSIS 111 Module Week 1 ASSIGNMENT BASIC ELEMENTS CSIS 111 Module Week 2 ASSIGNMENT INPUT OUTPUT CSIS 111 Module Week 3 ASSIGNMENT CONTROL STRUCTURES IF ELSE CSIS 111 Module Week 4 ASSIGNMENT CONTROL STRUCTURES WHILE FOR DO CASE CSIS 111 Module Week 5 ASSIGNMENT USER DEFINED FUNCTIONS CSIS 111 Module Week 6 ASSIGNMENT USER DEFINED SIMPLE DATA TYPES STRING TYPES CSIS 111 Module Week 7 ASSIGNMENT ARRAYS

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.