4138 Shares

In this assignment you will create a simplified version of the game battleship?

In this assignment you will create a simplified version of the game battleship? Topic: picture of homework
June 17, 2019 / By Braidy
Question: f you are not familiar with battleship you can read about it online. We will be modeling one side of the game. Basically the Battleship class will read in a list of ships and coordinates from a file and set up a grid for your opponent. The grid will be 10x10. Each ship occupies 1-5 squares on the grid in a straight line, depending on the size of the ship. Coordinates are labeled from 1-10 for the X-axis and from A-J (top to bottom) for the Y-axis. You can then take shots at squares on the grid. Battleship will let you know if you have a hit or a miss and will let you know when you have sunk a ship (hit all of its squares). Battleship will also display the current state of the game from the player’s perspective as a Picture object that is updated after each shot.
Best Answer

Best Answers: In this assignment you will create a simplified version of the game battleship?

Adison Adison | 5 days ago
What is your question? What you can do is format the file to be comma delimited or something similar. Each delimited space will have a 0 or a 1. A 1 represents a space occupied by a ship, and a 0 represents an empty space. You could also design a shipFile generator that randomly picks a spot and an orientation for each ship and places it. After you get the file situated, get the program to read the file and set up a double dimension area. Then, you can go two routes: Set up the GUI for the game or set up the functions to check if a ship is sunk. For the former, you could simply draw 11 lines vertically and horizontally on an applet form. Otherwise, you could make a picture of 10x10 squares and use it as a background image. As for the latter, you may want to make an additional class for each ship. This class could have size, start position, and direction. Or.. it could have an another class called points. Each of these points has a "hit" "X" and "Y" attribute. etc etc. If you want other people to do your homework, you are cheating only yourself. You are in this programming class either because you want to program or it is required for you major. If you want to program, this is good practice and you should enjoy it... If it's required for your major, you'll likely need it the experience in your profession. Asking people to do your homework will likely make you end up living a mediocre life. Either do the homework or drop out and give the parking spot to someone who's willing to work.
👍 178 | 👎 5
Did you like the answer? In this assignment you will create a simplified version of the game battleship? Share with your friends

We found more questions related to the topic: picture of homework


Adison Originally Answered: Name Game - Create a Family?
Mom/Dad A - Art Nathan B - Beatrice Margaret #1Son/family C - Cillian Patrick D - Delia Marie E - Edgar Patrick F - Frances Angela G - Georgette Agnes H - Henry Cillian #2Daughter/family I - Isolde Regina J - John Joseph K - Kerry John L - Liam Joseph M - Margaret Winifred #3Son/family N - Nathan Malachy O - Oonagh Helen P - Pearl Cordelia Q - Queen Esmerelda R - Ruby Cleopatra #4Son/family S - Seamus Brian T - Theresa Bernadette U - Uilliam Xavier V - Vaughn Ignatius #5Daughter/family W - Winifred Orla X - Xavier Francis Y - Yseult Beatrice Z - Zavier Art I love this family. I made up a whole story for them! Art and Beatrice Hogan had Cillian, Isolde, Nathan, Seamus, and Winifred. Winnie and Izzy were very close, being the only girls. Cillian married an Italian. They met when Cillian, an innocent bystander, was struck in the head with a home office projectile during yet another break-up with Delia's longtime boyfriend, Carmine. Their twins both have middle names that start with A, while Frances and Agnes have the same ending sound and Georgette and Angela both have those soft G's. Henry was named after Delia's younger brother, who passed away weeks before he was born. They had the name Hugo picked out for him before that. Isolde is the most grounded of the siblings. She married a good provider and a great father. They have three adored children - their only girl is named after Izzy's mother and sister. Their oldest was recently accepted into Notre Dame - he is named for John's father, Kerry John O'Carroll. Nathan is sort of the black sheep of the family. He married an artist and they live together in the woods of Vermont. Their triplets are all named for gems and royalty. Cordelia, King Lear's daughter, and Esmerelda, meaning Emerald. At two years old, Queenie is already living up to her name. Pearl is the only grandchild that carries on Beatrice's red hair! Seamus married Theresa, the very Catholic only child, of a Scottish immigrant. Although Seamus and his father-in-law don't get along, he and Theresa named their sons after him - Uilliam Aloysius Vaughn. Both boys have middle names of Saints. Winnie met Xavier at a Bruce Springsteen Concert when she was 17. Both flighty, both youngest children, they aren't the perfect match, except that they love each other passionately. Winnie named her daughter after her best friend: her older sister, and her mother. She named her son after her husband and her father. They recently moved out of Art and Bea's home and are 20 and 22 years old. Thanks for letting me do all that unnecessary storytelling!
Adison Originally Answered: Name Game - Create a Family?
A Husband/Father – Arion Gabriel B Wife/Mother – Brielle Olivia C #1 Son – Colton Thomas D Son's Wife – Desiree Danielle E 1-son – Elijah Jackson F 1-daughter (twin) – Faline Alexandra G 1-daughter (twin) – Gwendolyn Alexis H 1-son – Hadden Christopher I #2 Daughter – Isabelle Hope J Daughter's husband – Jaggar James K 2-daughter – Kenadi Grace L 2-son – Levi Lawrence M 2-daughter – Madison Rose N #3 Son – Nolan Nathaniel O Son's Wife – Olivia Marie P 3-daughter (triplets) – Piper Mae Q 3-daughter (triplets) – Quinn Faye R 3-daughter (triplets) – Rylee Rae S #4 Son – Solon Ross T Son's Wife – Taylor Faith U 4-son – Uri Alexander V 4-son – Vincent Isaiah W #5 Daughter – Willow Christine X Daughter's husband – Xavier Benjamin Y 5-daughter – Yvonne Gabrielle Z 5-son – Zeevi Michael This was a fun and different game and I understood that some of the middle names could start with the letter listed, but I wanted to use the letter for all the first names. :D.
Adison Originally Answered: Name Game - Create a Family?
A Husband/Father Alexander William Reed B Wife/Mother Beatrice Catherine (Hoffman) Reed C #1 Son Collin William Reed D Son's Wife Diana Tracy (Phillips) Reed E 1-son Eric William Reed F 1-daughter (twin) Felicia Michelle Reed G 1-daughter (twin) Guinevere Helena Reed H 1-son Heath Charles Reed I #2 Daughter Isleen Catherine (Reed) Christensen J Daughter's husband James Parker Christensen K 2-daughter Katherine Amelia Christensen L 2-son Louis Daniel Christensen M 2-daughter Maria Beatrice Christensen N #3 Son Nathan Wesley Reed O Son's Wife Olivia Christine (Lewis) Reed P 3-daughter (triplets) Paige Christine Reed Q 3-daughter (triplets) Quinn Beatrice Reed R 3-daughter (triplets) Rachel Catherine Reed S #4 Son Samuel Allen Reed T Son's Wife Taylor Alanna (Hughes) Reed U 4-son Ulysses Carter Reed V 4-son Vincent Archibald Reed W #5 Daughter Wren Stephanie (Reed) Davis X Daughter's husband Xander Bartholomew Davis Y 5-daughter Yvette Catherine Davis Z 5-son Zane William Davis

Stephanie Stephanie
(((Occulty))) What a brilliant party game theory, I in no way could have seen that lol. it would additionally make the sport extra thrilling, exceptionally while that's taking a while to bomb the heck out of someones' deliver ;)
👍 70 | 👎 -3

Stephanie Originally Answered: How can magic formula be derived and/or simplified?
I followed your logic until you said: "a=d/t^2"; I don't understand why you wrote that. It seems to be wrong by a factor of "2". Should be "a=2d/t^2", shouldn't it? But let's look at the formula "D=½gt²" by itself. It applies in the case where the object starts (or ends) at rest. Here's one way to derive it. We know this by definition: (average speed) = D/t We also know this by definition: g = (change in speed) / t Now, let's say the object is dropped from rest, and at the end of "t" seconds it has acquired a speed "V". In this case, its change in speed is just (V-0)=V. So: g = (change in speed) / t g = V/t Also, in cases where the acceleration is constant, the "average speed" is easily calculated: it is just the average of the initial speed and the final speed: average speed = (V_initial + V_final)/2 [If acceleration is constant] We have said that V_initial=0 and V_final=V, so: average speed = (0 + V)/2 = V/2 Substitute into previous equation for "average speed": average speed = D/t V/2 = D/t So now we have these two equations: g = V/t V/2 = D/t Rewrite them as: V = gt V = 2D/t Set those equal: gt = 2D/t Solve for "D": D = ½gt² Finally, notice that we made the assumption that the acceleration ("g") is constant. In cases where the acceleration changes over time, this formula is not valid.

If you have your own answer to the question picture of homework, then you can write your own version, using the form below for an extended answer.