Write a program that generates a random integer

Assignment Help Basic Computer Science
Reference no: EM13210231

Write a program that generates a random integer in the (inclusive) range [0-9] (i.e. the set {0,1,2,3,4,5,6,7,8,9}) and ask the user to guess what the number is . if the user's guess is higher than the random number the program should display, "Too high, try again" if the user's guess is lower than the random number the program should display, "Too low, try again" if the user wants to give up, he/she can enter a -1, in which case your program should display the correct answer and terminate. if the user wins, display the message, "you win!" You should also display the number of guesses that were made to win. Finally display the message, "please play again soon!"

Reference no: EM13210231

Questions Cloud

Difference between bourgeois and proletarians : What does it mean to say"Australia is a classless society" and explain the difference between bourgeois and proletarians and why it may be a key factor in marking boundaries of wealth.Is it still relevant today? Why?
Determine what was the inflation rate : Let's consider the effects of inflation in an economy composed of only two people: Bob, a bean farmer, and Rita, a rice farmer. Bob and Rita always consume equal amounts of rice and beans. In 2010, the price of beans was $1, and the price of rice w..
Compute the hypothetical retention times for caffine : Calculate the hypothetical retention times for caffine and aspartame if their retention factors were reduced by 28.0 %. Assume the mobile phase retention time (tm= 29.7 s) remains constant.
Explain the partition coefficient between ether and water : Extract a solute from 100 mL of water using only 300 mL of ether. The partition coefficient between ether and water is 3.0. Calculate q, the fraction of solute that would remain in the water under each of the following extraction conditions
Write a program that generates a random integer : Write a program that generates a random integer in the (inclusive) range [0-9] (i.e. the set {0,1,2,3,4,5,6,7,8,9}) and ask the user to guess what the number is .
Compute the volume of 0.050m barium hydroxide : calculate the volume of 0.050M Barium Hydroxide solution that contains the same number of moles
Perspectives and emphases within cognitive psychology : What are some perspectives and emphases within cognitive psychology that are currently affecting educators' thinking about how to improve the teaching/learning process?
State the partial molar volumes of water and ethanol : The partial molar volumes of water and ethanol in a solution with x(H2O) = 0.40 at 25 degrees C are 16.9 and 57.5 cm^3/mol, respectively.
Compute the ionic strength of a solution : Calculate the ionic strength of a solution that is 0.05 mol/kg in Na3[Fe(CN)6](aq), 0.02 mol/kg NaCl(aq),

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a program that reads in the length and width

Write a program that reads in the length and width of a rectangular yard (in meters) and the length and width of a rectangular house (in meters) placed in the yard.

  Describe where to apply continuum mechanics

Mechanics of material modelled as continuum is called Continuum Mechanics. Where can you apply continuum mechanics? Continuum mechanics has been successfully applied to solids.

  Explain traffic control devices to alert drivers

Are all intersections located safely with respect to horizontal and vertical alignment? Where intersections happen at end of high-speed environments (e.g., at approaches to towns); are there traffic control devices to alert drivers?

  Will action alter or destroy any historical and scientific

Will action alter or destroy any historical, scientific, or archaeological site? New engineering building project doesn't have any reported historical, scientific.

  Communication links on the telephone network

The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee. Suppose the telephone network of a company named RT&T is a fre..

  Describe constraints which encode that cell is observed

Describe constraints which encode that cell (1, 2) is observed and indicates mine is not present, that cell (2, 1) is observed and indicates a mine is present, and that remaining cells are unobserved.

  Choose one schedule development tools

In this discussion, choose one of the schedule development tools introduced or another tool that you are already familiar with that was not identified in the studies. Identify the tool and complete the following.

  Optimal value of the objective function

Find the optimal value of the objective function for the following problem by only inspecting its dual. (Do not solve the dual by the simplex method)

  Intermediate steps for a translation

How the results and intermediate steps for a translation of (20,40,-10), a rotation of 135 degrees about the z-axis applied to a starting point of (45,-95,20). Perform a separate operation applying scale with scale factors of sx=2.0, sy=1.6 and sz..

  Swot analysis results of the new ict service

Compare the SWOT Analysis results of the current ICT service with the SWOT Analysis results of the new ICT service.

  What are techniques to use in planning presentation

You prepared and distributed a system requirements document, and you anticipate some intense questioning at the meeting. When planning your presentation, what are some techniques you will use?

  Condition to resume sending messages related to application

Give an example that illustrates why P must not be allowed to do so and state a condition that defines when P may resume sending messages related to application.

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