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 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Janice usually works on a particular workbook that contains all business related data. she decides to keep a backup of all the data in a separate workbook. she opens a new workbook to transfer the data. which option should she use to copy all the data from one workbook to another workbook?
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
Mathematics, 02.04.2021 04:30
question
Mathematics, 02.04.2021 04:30
question
Mathematics, 02.04.2021 04:30
question
Biology, 02.04.2021 04:30
Questions on the website: 13722359