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, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runners’ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 24.06.2019 02:00
Which steps will open the system so that you can enter a question and do a search for
Answers: 1
question
Computers and Technology, 24.06.2019 08:30
Formatting rows and columns is similar to cell formatting. in an openoffice calc spreadsheet, you can format data entered into rows and columns with the of the rows and columns options. you can insert rows and columns into, or delete rows and columns from, a spreadsheet. use the insert or delete rows and columns option on the insert tab. alternatively, select the row or column where you want new rows or columns to appear, right-click, and select insert only row or only column options. you can hide or show rows and columns in a spreadsheet. use the hide or show option on the format tab. for example, to hide a row, first select the row, then choose the insert tab, then select the row option, and then select hide. alternatively, you can select the row or columns, right-click, and select the hide or show option. you can adjust the height of rows and width of columns. select row and then select the height option on the format tab. similarly, select column, then select the width option on the format tab. alternatively, you can hold the mouse on the row and column divider, and drag the double arrow to the position. you can also use the autofit option on the table tab to resize rows and columns.
Answers: 1
question
Computers and Technology, 24.06.2019 13:50
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
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