Write a number guessing program

Assignment Help Computer Engineering
Reference no: EM132174933

Using Python:

Write a number guessing program. You should think of a number between 1 and 100. Then, over and over again, the computer can suggest an answer.

If that answer is too small, you enter the character >.

If the computer's answer is too large, you enter the character <. If the computer's answer is just right, you print "You win!" First write a program to play this game once, until the computer wins. After that is working, write a program that plays the game over and over, each time with a different number.

You can use the random number generator to generate the numbers.

Count the number of guesses for each game, and print the average number of guesses. There is a slow algorithm for finding the number, and a faster algorithm.

The slow algorithm is acceptable, but the fast algorithm is much better. Use the fastest algorithm you can think of.

Reference no: EM132174933

Questions Cloud

Eat of death due to high levels of toxic alcohol : Why would an organism utilize alcohol fermentation if it is wasteful of the energy in food molecules and poses a threat of death due to high levels of toxic alc
Compute the mean and standard deviation of the data : Using python You need to take a text file containing numerical data, You need to compute the mean, and standard deviation of the data.
Amount of atp to sustain life : Normally our body will run aerobic respiration in order to produce the required amount of ATP to sustain life.
Rate of respiration in mammal : If respiration in a small mammal were studied at both room temperature (21 Celsius) and 10 degrees Celsius, what results would you predict?
Write a number guessing program : Write a number guessing program. You should think of a number between 1 and 100. Then, over and over again, the computer can suggest an answer.
A function that take a space delimited text as a parameter : Write a function named mostCommonWord() that takes a space delimited text as a parameter and return the most common word.
What is the difference between r and k selective : What is the difference between R and K selective? Provide an example of a K specialist species and an R specialist species
Explain how the 2 major observations that darwin : Explain how the 2 major observations that Darwin made relate to the 2 Inferences that he drew from them
Write a program in r to plot running time vs n for each : Write a program in R to plot running time vs n for each function, either as 3 separate plots, or on a single combined plot.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Design a minimum synchronous sequential circuit

Design a minimum synchronous sequential circuit to detect the sequence 1001. Sequences may overlap. Use SR flip-flops.

  Discuss full implementation and acceptance of the new system

Make a recommendation to senior management about preventing possible barriers for full implementation and acceptance of the new system

  Define the boolean function that returns one

The tic-tac-toe is a 2 player's game using a 3x3 grid of squares. The players alternate turn. Each player places a mark (one player uses X and the other O) in a square. The first player with three marks in a row, in a column or on a diagonal wins ..

  Design a one-bit alu that will perform bitwise addition and

Design a 1bit ALU that will perform bitwise addition AND, OR & NOT on 1 bit input x and y. 1 bit output z is produced for the case addition.

  What was the scoop and results of the project

Describe an IT or similar business project you have done or are currently doing. In your discussion, provide information on the following.

  Examine the web sites regarding your suggestions

Examine the Web sites regarding your suggestions as to how they might be improved. Create a PowerPoint presentation that includes 10-12 slides with voice recording that presents your recommended improvements.

  Give utilization of the cpu for the given two processes

Two real-time methods are running on a computer. The first one runs every 25 msec for 10 msec. The second one runs every 40 msec for 15 msec. What is the utilization of the CPU for the given two processes?

  What are the criteria by which address decoders are judged

What does primary address range mean when it is applied to a system using partial address decoding?

  Is the philosophy behind the innovation open or closed

Why you picked those two innovations and if you believe they are either more harmful or more beneficial for the organization.

  What is the trap

The 68000 has a rich instruction set. However, some of these instructions overlap and perform almost the same function. If you were to streamline the 68000.

  Fuzzy system for forecasting electricity price

A Fuzzy System for Forecasting Electricity Price - Develop a fuzzy forecasting system using Matlab Toolbox. The system performs a forecasting task for power marketing price.

  How many rounds the player has won

If the player rolls a total of 7 or 11 in the first round, the player wins. If the player rolls a total of 2, 3, or 12 in the first round, the player loses.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd