answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
denpristay
1 month ago
9

SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R

eference have been imported where appropriate. Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied. In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit. This question involves a game that is played with multiple spinners. You will write two methods in the SpinnerGame class below. public class SpinnerGame { /** Precondition: min < max * Simulates a spin of a spinner by returning a random integer * between min and max, inclusive. */ public int spin(int min, int max) { /* to be implemented in part (a) */ } /** Simulates one round of the game as described in part (b). */ public void playRound() { /* to be implemented in part (b) */ } } (a) The spin method simulates a spin of a fair spinner. The method returns a random integer between min and max, inclusive. Complete the spin method below by assigning this random integer to result. /** Precondition: min < max * Simulates a spin of a spinner by returning a random integer * between min and max, inclusive. */ public int spin(int min, int max) { int result; return result; }

Computers and Technology
1 answer:
8_murik_8 [892]1 month ago
4 0

Response:

See the details below

Details:

Coin for Player 1

Coin for Player 2

Player 1's Turn

Player 2's Turn

Round Number

Count at

Count at

Current Player

Current Player

Type of Coin

Type of Coin

Identifier

Start of

Start of

1

2

Result

Count at

Count at

Next Round

Next Round

Expenditure

Expenditure

End of

End of

Round

Round

Off by

one,

10 - 1

10

10

2

second player

10 - 2

+

= 8

1

receives 1

=

10

coin

Similarly,

10 - 2

2

8

10

2

2

second player

-

receives 1

6

+

=

1

=

9

coin

Off by

two,

6 - 1

+

3

6

9

3

player 1

2

9 - 3

receives 2

=

=

7

6

coins

Similarly,

4

7

6

2

2

second player

7 - 2

6 - 2+

receives 1

=

5

=

coin

5

Please refer to the below image for a neatly organized table to aid in solving the aforementioned question.

You might be interested in
This question refers to a standard deck of playing cards. If you are unfamiliar with playing cards, there is an explanation in P
Amiraneli [921]

Answer:

Explanation:

The number of combinations to select 10 girls is 35C₁₀

The number of combinations to select 10 boys is also 35C₁₀

Thus, the total combinations for selection is 35C₁₀ x 35C₁₀

4 0
16 days ago
Read 2 more answers
Start with the following Python code. alphabet = "abcdefghijklmnopqrstuvwxyz" test_dups = ["zzz","dog","bookkeeper","subdermatog
maria [879]

Answer:

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

# From Section 11.2 of: # Downey, A. (2015). Think Python: How to think like a computer scientist. Needham, Massachusetts: Green Tree Press.

def histogram(s):

d = dict()

for c in s:

if c not in d:

d[c] = 1

else:

d[c] += 1

return d

#Part 1 Construct a function, called has_duplicates, that takes a string argument and returns True if there are any repeating characters present. If not, it should return False.

def has_duplicates(stringP):

dic = histogram(stringP)

for key,value in dic.items():

if value>1:

return True

return False

# Execute has_duplicates by building a histogram using the above histogram function. Implement a loop over the items in the test_dups list.

# Display each string and indicate whether it has duplicates based on the has_duplicates function's result for that string.

# For instance, the expected output for "aaa" and "abc" would be shown below. aaa has duplicates abc has no duplicates Display a similar message for each string within test_dups.

print("***Implementation of has_duplicates function***")

for sTr in test_dups:

if has_duplicates(sTr):

print(sTr+": has duplicates")

else:

print(sTr+": has no duplicates")

#Part 2 Develop a function named missing_letters that takes a string argument and returns a new string containing all alphabet letters absent from the input string.

#The letters in the resultant string should be arranged in alphabetical order. Your implementation must utilize the histogram from the previous function and should reference the global alphabet variable directly.

#It should iterate over the alphabet letters to figure out which are missing from the input string.

#The function missing_letters should merge the list of missing letters into a string and return it.

def missing_letters(sTr):

missingLettersList = []

dic = histogram(sTr)

for l in alphabet:

if l not in dic:

missingLettersList.append(l)

missingLettersList.sort()

return "".join(missingLettersList)

#Iterate over the strings in the test_miss list and invoke missing_letters for each one. Present a line for each string outlining the missing letters.

#For example, for the string "aaa", the output should be as follows. aaa is missing letters bcdefghijklmnopqrstuvwxyz

#Should the string encompass all alphabet letters, the output should indicate that it utilizes all the letters.

#For instance, output for the alphabet string itself would be: abcdefghijklmnopqrstuvwxyz uses all the letters

#Generate a similar line for each item in test_miss.

print("\n***Implementation of missing_letters function***")

for lTm in test_miss:

sTr = missing_letters(lTm.replace(" ",""))

if sTr!="":

print(lTm+" is missing letters "+sTr)

else:

print(lTm +" uses all the letters")

3 0
1 month ago
How to code 2.9.5: Four colored triangles {Code HS}
zubka84 [942]

Response: penup()

backward(100)

for i in range(4):

pensize(5)

pendown()

left(60)

color("green")

forward(50)

right(120)

color("blue")

forward(50)

color("red")

right(120)

forward(50)

penup()

left(180)

forward(50)

Clarification:

L

6 0
1 month ago
Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename
amid [800]

This code is in Python. I'm not certain what programming language you need.

Refer to the image:

7 0
1 month ago
Read 2 more answers
Find true or false. A hacker is hacking software with access in sensitive information from your computer​
Harlamova29_29 [932]
IT'S CORRECT!! I LOOKED IT UP
7 0
20 days ago
Other questions:
  • To reduce costs and the environmental impact of commuting, your company decides to close a number of offices and to provide supp
    14·1 answer
  • Susan is assisting a web designer to create a promotional web page on eco-friendly classroom designs. She uses color combination
    5·1 answer
  • A technician with a PC is using multiple applications while connected to the Internet. How is the PC able to keep track of the d
    8·2 answers
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 the output is
    5·1 answer
  • Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li
    11·1 answer
  • What type of memory can support quad, triple, and dual channels?
    5·1 answer
  • If a cell reference is c6, this cell is in the sixth column and the third row. true or false
    11·2 answers
  • A wireless network does not benefit like a wired network does, when it comes to collision reduction. Which device reduces collis
    6·1 answer
  • The position of a runner in a race is a type of analog data. The runner’s position is tracked using sensors. Which of the follow
    8·1 answer
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!