1answer.
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
Ratling [72]
3 years ago
11

Does anybody have the code to 2.19.4: Guess a Number 2.0 in codeHS??

Computers and Technology
1 answer:
Tcecarenko [31]3 years ago
6 0

Answer:

speed(0)

secret_number = 9

pensize(10)

def green_check():

   color("green")

   penup()

   backward(25)

   right(45)

   pendown()

   forward(35)

   left(90)

   forward(75)

   

def draw_arrow():

   color("red")

   left(90)

   forward(50)

   left(45)

   backward(25)

   forward(25)

   right(90)

   backward(25)

   forward(25)

   left(45)

   backward(100)

   forward(50)

   right(90)

   

user_number = int(input("Guess a number between 1 and 10: "))

while user_number != secret_number:

   if user_number < secret_number:

       draw_arrow()

   else:

       left(180)

       draw_arrow()

       right(180)

   user_number = int(input("Guess a number between 1 and 10: "))

   clear()

   

green_check()speed(0)

secret_number = 9

pensize(10)

def green_check():

   color("green")

   penup()

   backward(25)

   right(45)

   pendown()

   forward(35)

   left(90)

   forward(75)

   

def draw_arrow():

   color("red")

   left(90)

   forward(50)

   left(45)

   backward(25)

   forward(25)

   right(90)

   backward(25)

   forward(25)

   left(45)

   backward(100)

   forward(50)

   right(90)

   

user_number = int(input("Guess a number between 1 and 10: "))

while user_number != secret_number:

   if user_number < secret_number:

       draw_arrow()

   else:

       left(180)

       draw_arrow()

       right(180)

   user_number = int(input("Guess a number between 1 and 10: "))

   clear()

   

green_check()

Explanation:

It's right

You might be interested in
Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program sh
babunello [35]

Answer:

In Python:

year = int(input("Years: "))

while year<1:

   year = int(input("Invalid. Enter 1 or greater: "))

total = 0

for i in range(1,year+1):

   for j in range(1,13):

       month = int(input("Year "+str(i)+", Month "+str(j)+": "))

       while month<0:

           month = int(input("Invalid. Enter 0 or greater: "))

       total+=month

ave = total/(12*year)

print("Months: "+str(12 * year))

print("Total: "+str(total))

print("Average: "+str(ave))

Explanation:

This gets the number of years

year = int(input("Years: "))

This loop validates the number of years

<em>while year<1:</em>

<em>    year = int(input("Invalid. Enter 1 or greater: "))</em>

<em />

This initializes total to 0

total = 0

This iterates through the years

for i in range(1,year+1):

This iterates through the month of each year

   for j in range(1,13):

This gets the rainfall for each month

       month = int(input("Year "+str(i)+", Month "+str(j)+": "))

This loop validates the amount of rainfall

<em>        while month<0:</em>

<em>            month = int(input("Invalid. Enter 0 or greater: "))</em>

This calculates the total rainfall

       total+=month

This calculates the average rainfall

ave = total/(12*year)

This prints the number of month

print("Months: "+str(12 * year))

This prints the calculated total amount of rainfall

print("Total: "+str(total))

This prints the calculated average amount of rainfall

print("Average: "+str(ave))

7 0
3 years ago
Which type of cell references are locked and NOT automatically updated when it’s copied
dsp73

Hi I would have to say B sorry if this answer is sucky but I'm trying my best to help you :D

4 0
3 years ago
Although the chi-square distribution is continuous, it is used to analyze discrete (counts) data
Roman55 [17]
This is true! The chi-square distribution is continuous and it is used to analyze discrete (counts) data.
4 0
4 years ago
What is assembler ? ​
kicyunya [14]

Answer:

An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer's processor can use to perform its basic operations.

8 0
3 years ago
Murray is a database technician. He has created a single enterprise database system. How is this better than multiple databases
EastWind [94]

Answer:

C

Explanation:

data consistency

5 0
3 years ago
Other questions:
  • Which of the following are stages in the computer life cycle? Check all of the boxes that apply.
    13·2 answers
  • Which of the following is the java comparison operator for "not equal to"
    10·1 answer
  • What feature of virtualization software allows you to revert to a previous point in time in the event you make an unrecoverable
    9·1 answer
  • Which category of management information systems (MIS) combines the forecasting capability of decision support software with the
    12·1 answer
  • Whose guidelines should you follow for the destruction of storage media such as thumb drives, Zip drives, and computers?
    6·1 answer
  • Write the output of the following program:
    8·1 answer
  • What do the Brainly points do? sorry im new here and i dont know how to internet rn .-.
    7·2 answers
  • Hey does anyone know how to fix a computer that goes on and off. It is a Asus chromebook and putting it into recovery mode didn'
    5·2 answers
  • When investigating the serial position curve, delaying the memory test for 30 seconds
    10·1 answer
  • TensorFlow and Pytorch are examples of which type of machine learning platform?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!