Discover
Questions library
Collections library
Find online teacher
login
Discover
questions library
Find online teacher
login
Popular searches:
if-else
class-diagram
flowchart
Polymorphism
Home
Questions
Questions
Study lists
Ashoor Questions
555 Questions
(Central city) Given a set of cities, the central city is the city that has the shortest total distance to all other cities. Write a program that prompts the user to enter the number of the cities and the locations of the cities (coordinates), and finds the central city and its total distance to all
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
199
(Game: connect four) Connect four is a two-player board game in which the players alternately drop colored disks into a seven-column, six-row vertically suspended grid, as shown below
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
2
235
(Pattern recognition: four consecutive equal numbers) Write the following method that tests whether a two-dimensional array has four consecutive numbers of the same value, either horizontally, vertically, or diagonally
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
191
(Shuffle rows) Write a method that shuffles the rows in a two-dimensional int array using the following header:
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
189
(Financial tsunami) Banks lend money to each other. In tough economic times, if a bank goes bankrupt, it may not be able to pay back the loan. A bank’s total assets are its current balance plus its loans to other banks
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
448
(Sort two-dimensional array) Write a method to sort a two-dimensional array using the following header:
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
283
(Geometry: same line?) Programming Exercise 6.39 gives a method for testing whether three points are on the same line. Write the following method to test whether all the points in the array points are on the same line
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
160
(Explore matrix) Write a program that prompts the user to enter the length of a square matrix, randomly fills in 0s and 1s into the matrix, prints the matrix, and finds the rows, columns, and diagonals with all 0s or 1s. Here is a sample run of the program:
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
270
(Locate the largest element) Write the following method that returns the location of the largest element in a two-dimensional array
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
171
(Financial application: compute tax) Rewrite Listing 3.5, ComputeTax.java, using arrays
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
192
(Game: nine heads and tails) Nine coins are placed in a 3-by-3 matrix with some face up and some face down. You can represent the state of the coins using a 3-by-3 matrix with values 0 (heads) and 1 (tails). Here are some examples:
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
172
(Largest row and column) Write a program that randomly fills in 0s and 1s into a 4-by-4 matrix, prints the matrix, and finds the first row and column with the most 1s. Here is a sample run of the program:
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
214
(Game: play a tic-tac-toe game) In a game of tic-tac-toe, two players take turns marking an available cell in a 3 * 3 grid with their respective tokens (either X or O)
Java programming
2022-06-05
Answers
30
Question
40
Followers
30
0
1
159
Total:
555
Previous
11
12
13
14
15
Next
Go