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
the volume of two similar solids are 1080cm and 1715cm .if the curved surface area of the smaller cone is 840cm .fond the curved
gavmur [86]

Answer:

A_{big} = 1143.33cm^2

Explanation:

The given parameters are:

V_{small} = 1080

V_{big} = 1715

C_{small} = 840

Required

Determine the curved surface area of the big cone

The volume of a cone is:

V = \frac{1}{3}\pi r^2h

For the big cone:

V_{big} = \frac{1}{3}\pi R^2H

Where

R = radius of the big cone and H = height of the big cone

For the small cone:

V_{small} = \frac{1}{3}\pi r^2h

Where

r = radius of the small cone and H = height of the small cone

Because both cones are similar, then:

\frac{H}{h} = \frac{R}{r}

and

\frac{V_{big}}{V_{small}} = \frac{\frac{1}{3}\pi R^2H}{\frac{1}{3}\pi r^2h}

\frac{V_{big}}{V_{small}} = \frac{R^2H}{r^2h}

Substitute values for Vbig and  Vsmall

\frac{1715}{1080} = \frac{R^2H}{r^2h}

Recall that:\frac{H}{h} = \frac{R}{r}

So, we have:

\frac{1715}{1080} = \frac{R^2*R}{r^2*r}

\frac{1715}{1080} = \frac{R^3}{r^3}

Take cube roots of both sides

\sqrt[3]{\frac{1715}{1080}} = \frac{R}{r}

Factorize

\sqrt[3]{\frac{343*5}{216*5}} = \frac{R}{r}

\sqrt[3]{\frac{343}{216}} = \frac{R}{r}

\frac{7}{6} = \frac{R}{r}

The curved surface area is calculated as:

Area = \pi rl

Where

l = slant\ height

For the big cone:

A_{big} = \pi RL

For the small cone

A_{small} = \pi rl

Because both cones are similar, then:

\frac{L}{l} = \frac{R}{r}

and

\frac{A_{big}}{A_{small}} = \frac{\pi RL}{\pi rl}

\frac{A_{big}}{A_{small}} = \frac{RL}{rl}

This gives:

\frac{A_{big}}{A_{small}} = \frac{R}{r} * \frac{L}{l}

Recall that:

\frac{L}{l} = \frac{R}{r}

So, we have:

\frac{A_{big}}{A_{small}} = \frac{R}{r} * \frac{R}{r}

\frac{A_{big}}{A_{small}} = (\frac{R}{r})^2

Make A_{big} the subject

A_{big} = (\frac{R}{r})^2 * A_{small}

Substitute values for \frac{R}{r} and A_{small}

A_{big} = (\frac{7}{6})^2 * 840

A_{big} = \frac{49}{36} * 840

A_{big} = \frac{49* 840}{36}

A_{big} = 1143.33cm^2

<em>Hence, the curved surface area of the big cone is 1143.33cm^2</em>

4 0
3 years ago
3. Create mode was one of the most innovative and influential features of which of the following games?
melamori03 [73]
FarmVille would be the correct answer because it is a game where you build a create your own farm without nobody telling you to this or that
8 0
3 years ago
Working together, printer A and printer B would finish the task in 24 minutes. Printer A alone would finish the task in 60 minut
sasho [114]

Answer:

The correct answer to this question is option (1).

Explanation:

Let x1 = Is number of pages that printer A can print  in page/minute.  

thus x1 + 5 = Is number of page that printer B can print in page/minute.  

As printer A finishes his work in 60 min. So the task has 60x1 pages. As printers A and B both finish that task in 24 minutes. So the equation can be given as:  

60x1 = 24x1 + 24(x1 + 5)  

 

60x1 = 24x1 + 24x1 + 120  

 

60x1=48x1 + 120

 

60x1-48x1=120

 

12x1=120  

 

x1=120/12

 

x1=10

put the value of x1 in to (60x1). Therefore, the task has 60(10) = 600 pages. the task contains 600 pages.  

So the answer to this question is option (1).

7 0
3 years ago
What are characteristics of the Advanced Calendar options in Outlook? Check all that apply.
anzhelika [568]

Answer:

Free/busy settings can be enabled.

One extra time zone can be created.

Display and theme settings can be changed.

Options are accessed through the Backstage view.

Explanation:

Just took it

7 0
3 years ago
A keyboard would be considered _____. Select 2 options.
Digiron [165]

Answer:

What are the 2 options?

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    11·2 answers
  • While doing online research you enter this keyword search with a truncation character: man* Which of the following would not be
    15·1 answer
  • What will be displayed if the following Java code segment is run? System.out.println("one "); System.out.print("two "); System.o
    12·1 answer
  • Write two cin statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a dash,
    7·1 answer
  • What can you find the under the privacy policy section of a shopping website?
    12·1 answer
  • Complete the sentence about entering and editing data in a cell in a spreadsheet.
    13·1 answer
  • A RISC processor has 186 total registers, with 18 global registers. There are 12 register windows, each with 10 locals. How many
    5·1 answer
  • how risk can impact each of the seven domains of a typical IT infrastructure: User, Workstation, Local Area Network (LAN), Local
    7·1 answer
  • Fre.e points enjoy em
    7·2 answers
  • What are the routes through with Virus transmitted into computer<br>system?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!