Enter row and column you want to hit: 3 5 Enter row and column you want to hit: 3 7 HIT Enter row and column you want to hit:

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter3: Coding With Variables, Named Constants, And Calculations
Section: Chapter Questions
Problem 20RQ: Most of the memory locations declared in an application should be class-level variables. a. True b....
icon
Related questions
Question

You should 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 should 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 should print “HIT AGAIN”. You should 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!”.

Question: Why is miss not appearing in the function.

Enter row and column you want to hit: 3 5
Enter row and column you want to hit: 3 7
HIT
Enter row and column you want to hit:
Transcribed Image Text:Enter row and column you want to hit: 3 5 Enter row and column you want to hit: 3 7 HIT Enter row and column you want to hit:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning