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
cupoosta [38]
3 years ago
7

Adam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correc

t answer. But when Adam tests the program, it always outputs that it took the user one guess, even when it takes many guesses. What error did Adam most likely make, and how should it be fixed?
Computers and Technology
1 answer:
Tpy6a [65]3 years ago
6 0

Answer:

This is the game guess the number. The computer ask you. Hey! I have thought of a number in between 1 and 20. Can you guess what the number is? If you predict correct, Computer says you guessed right and in so and so number of times. Or else if your guess is larger than guess than it says your guess is too high and it says too low if guessed number is less than the guess. However, in this program it always says it guessed right in one attempt. Actually, we use here if else ladder, The problem is in this if else ladder expression. It has not been set properly. Hence, Adam needs to check that part of the program.

if guessd_number == guess:

            attempt++

            print( "you guessed right in" +attempt+"attempts)

elif guessed_number < guess:

            attempt++

            print("your guess is too low")

else:

            attempt++

            print("your guess is too high")

And this will be inside a while loop. The problem is definitely here.

Explanation:

The answer is self explanatory.

You might be interested in
Why might a photographer be interested in capturing the human element in his/her images? Describe your favorite example that dem
Andrej [43]
1) A photographer be interested in capturing the human element in his/her images because human beings can be as inspiring as everything that surrounds a photographer. Every artist has its own source of inspiration, and what if artist is the inspiration itself? Exploring human's beauty is the main part of developing your art (in this case photography) skills. 
2) I find hands, to be more exact,wrists, to be the most inspiring part of human body. There is a philosophical aspect in my opinion becuase people use their hands to create. Every person is unique, its hands are unique and these hands can create unique things.
7 0
3 years ago
The term composite would be used to describe an image that was altered by the Crop tool.
patriot [66]

Answer:

Would it be false?

5 0
3 years ago
__________ refers to the coupling of data stored in files and the specific programs required to update and maintain those files
atroni [7]
I think it is good for the environment
7 0
4 years ago
Cameras absorb and record the reflected light from objects through a series of lenses. true or false? PLEASE HELP ASAP
mylen [45]

Answer:

True

Explanation:

Cameras absorb and record the reflected light from objects through a series of lenses, which are similar to the lenses that might be in someone's glasses

7 0
4 years ago
Read 2 more answers
Clarissa is a computer programming consultant. When a client states that they have an extremely complex programming task, which
Ann [662]

Answer:i think its D it makes more sense also can i get brainliest

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • ___________ is an unsecured client server application / protocol that transfers files between two computers.
    11·1 answer
  • Successful Alignment of IT with Business/Project Prioritization Refer to the readings for this week on aligning IT to the busine
    10·1 answer
  • DOUBLE POINTS!! PLEASE HELP QUICKLY!!!!!
    15·2 answers
  • Which technology provides a solution to IPv4 address depletion by allowing multiple devices to share one public IP address
    13·1 answer
  • Catherine purchased dried herbs from the grocery store. Which structure would she use if wanted to create a mixture of powdered
    8·2 answers
  • 4. Why does Hancock believe that our communication online is more honest than we might<br> expect?
    15·2 answers
  • Who would benefit from using self-driving cars
    10·2 answers
  • How to execute python code in command prompt *window*?
    5·1 answer
  • What are some benefits that each computer system being used?
    12·2 answers
  • Pls say correct guyz pls pls pls
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!