subject

Do the following in introductory-level java also post screen shotsa gameto pass the time during long voyages, viking sailors would play the two-player game of havsta. in this assignment, you'll implement the game, but play will be against the computer. during each round, players choose a move, which may be either applaro, svartrå, tunholmen, or godafton. the rules are: applaro beats svartrå and tunholmensvartrå beats tunholmentunholmen beats godaftongodafton beats applaro and svartråthe computer wins in the event of a tie. your program should behave as follows: the rules should be printed to the screenthe user is asked if they'd like to play a roundif they choose 'y', a round is playedif they choose 'n', the program endsuntil the user has chosen to quit, another round is played. in a round of play: the user is asked to enter a move, which may be either svartrå, tunholmen, äpplaro, or godafton. the program should continue to prompt the user until a valid move is entered. the computer makes a move at random. (hint: remember how we generated random numbers in class.)the program prints the computer's move, the user's move, and who is the winner of this round. the user is asked if they'd like to continue. when the user has decided to quit the game, the program prints the number of: rounds playedtimes the user wontimes the computer wonsuggestionsan important skill in programming is learning how to break up a big job into smaller tasks. make an outline. make sure that your outline makes sense. test it out with real input using pencil and paper. do this before you start writing code. turn some of the individual steps of your outline into functions. some obvious choices might be a function which generates the computer's move at random. another would be a function which is passed two moves and returns the winner. the goal should be that the functions make your code as readable as your english-language outline. you don't need to implement all of the functions at first. just write placeholders (we call these stubs) first and fill them in later. implement and test your stub functions. also remember to test things as you go. it's easier to find a mistake in 5 lines of code than it is to find a mistake in 500 lines of code.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
The width of a piece of rectangular land is 5m shorter rhan 1/3 of its length .find the width of the land if the length is 60m,150m.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 1
question
Computers and Technology, 25.06.2019 01:20
Jason typically uses the internet to buy various items. it the total cost of all of the items ordered, at one time, is $250 or more, then the shipping and handling is free, otherwise the shipping and handling is $15 per item. design an algorithm that prompts jason to enter the number of items ordered and the price of each item. (remember cost = number of items order times price) the algorithm then outputs the total billing amount including shipping and handling. your algorithm must use a loop (repetition structure) to get the number and price of each item. write this in algorithm format not program code format.
Answers: 2
question
Computers and Technology, 25.06.2019 07:30
Which behavior demonstrates teamwork
Answers: 1
You know the right answer?
Do the following in introductory-level java also post screen shotsa gameto pass the time during long...
Questions
question
Geography, 08.02.2021 19:40
question
Spanish, 08.02.2021 19:40
question
Physics, 08.02.2021 19:40
Questions on the website: 13722362