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
In which slot is a video card most commonly installed within a laptop?
lesya692 [45]

Answer:

PCIe

Explanation:

If we're talking about video slot the PCI is the most commonly installed in a laptop, but in this case, we have the PCIE or PCI-Express, this was the most common video slot in 2007 and is confused for the PCI-X.

We can increase the bandwidth with this video slot, this slot PCI-X could be 32 times faster than PCI 2.1, with PCIE 1.1 we can transport 250mb/s in each direction.

8 0
3 years ago
Busca información (nombre, potencia y situación) de los parques eólicos de la Comunidad Valenciana. con más de 40 MW de potencia
Colt1911 [192]
I need this answer too can someone please help us out with the right answer ?!

Explanation:
6 0
3 years ago
Write a java program to input the corresponding data to print the result of the following expression
Anna71 [15]

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 float a, b, c, x, y;

 a = input.nextFloat();

 b = input.nextFloat();

 c = input.nextFloat();

 x = input.nextFloat();

 y = a * x * x + b * x + c;

 System.out.print(y); }}

Explanation:

This declares all variables

 float a, b, c, x, y;

The next 4 lines get input for a, b, c and x

<em>  a = input.nextFloat();</em>

<em>  b = input.nextFloat();</em>

<em>  c = input.nextFloat();</em>

<em>  x = input.nextFloat();</em>

This calculates the value of y using y = ax^2 + bx + c

y = a * x * x + b * x + c;

This prints the calculated value of y

 System.out.print(y);

6 0
3 years ago
What are some situations where you might find it useful to use the “!” symbol in a program?
bija089 [108]

Answer:

Conversations

Explanation:

You may find confusing when "!" doesn't work for any command line. But if you have any exclamatory conversation, just add it in :)

Hope this help :>

5 0
3 years ago
____ view allows you to create or modify a worksheet while viewing how it will look in printed format.
Korolek [52]
WHICH view allows you to create or modify a worksheet while viewing how it will look in a printed format. Answer: <span>Page Layout View The Page Layout View</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Describe one difference and one similarity between science and pseudoscience.
    8·1 answer
  • Shelly praised Susan via email for how well she executed an employee training program last week. Shelly is engaging in the _____
    6·1 answer
  • SOMEONE PLEASE HELP ASAP!!
    14·2 answers
  • Why should spain go to Africa ​
    15·1 answer
  • the mail merge feature can be used to address the same letter to several different people , true or false
    13·2 answers
  • I have lost the watch (that,which) you gave me​
    12·1 answer
  • What is the full form of GUI​
    10·2 answers
  • On the MarketingConsultants worksheet, in cells D10:H13, use a PMT function to calculate the end of the month payment amount. En
    15·1 answer
  • Anil needs to show the overlap of people who live in a certain neighborhood in his city and who support a specific political can
    9·1 answer
  • write a program which prompts the user for a celsius temperature, convert the temperature to fahrenheit, and print out the conve
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!