subject

Implement a person class storing a person's name (as a string) and age (as an int). you should provide a constructor that accepts the name as the first argument and the age as the second argument. you should implement hashcode as described here. specifically: if hashcode is called twice on the same object-that is, if neither the name or age has been changed- it should return the same int. if two persons are equal-that is, have the same name and age-hashcode should return the same value. in this case, if two person objects are not equal your hashcode implementation should return different results. we will test this using random inputs. note that strings have their own hashcode method which you may want to use in your implementation. an int is not an object and so doesn't provide hashcode, but there are several ways to include it in your implementation. also note that you may not be able to complete this homework problem until after the lecture on hashing.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
What is the algorithm for building a binary tree program
Answers: 2
question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 22.06.2019 17:40
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i.e., still have an asterisk in it).
Answers: 1
You know the right answer?
Implement a person class storing a person's name (as a string) and age (as an int). you should provi...
Questions
question
Mathematics, 29.02.2020 21:03
question
Advanced Placement (AP), 29.02.2020 21:04