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 10:00
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
You know the right answer?
Do the following in introductory-level java also post screen shotsa gameto pass the time during long...
Questions
Questions on the website: 13722361