Write a program that generates a random integer

Assignment Help Basic Computer Science
Reference no: EM13210212

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: EM13210212

Questions Cloud

Explain 4-chloro-1,4-dimethylhexanol is treated with heat : 4-chloro-1,4-dimethylhexanol is treated with heat, please show products
Calculate the price elasticity of demand for bottled water : The demand for bottled water in a small town is as follows: Price per bottle Quantity demanded $1.00 500 $1.50 400 $2.00 300 $2.50 200 $3.00 100 Calculate the price elasticity of demand for bottled water for a price rise from $1.00 to $1.50.
How nation is going to attain high level of economic progres : The secretary of state has asked you to prepare a memo describing the key policies and economic arrangements that a specific less developed country should follow in order to achieve rapid growth and higher income levels.
What is total surplus after the tax : Andre walks Julia's dog once a day for $50 per week. Julia values this service at $60 per week, while the op-portunity cost of Andre's time is $30 per week. The government places a tax of $35 per week on dog walkers. After the tax, what is total s..
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.
What is the difference between text i/o and binary i/o : What is the difference between text I/O and binary I/O?
What is the future worth of the cost of the machinery : A company is going to upgrade it machinery. It costs $150,000 to buy the machinery and have it installed. Operation and maintenance cost are $1500 per year for the first 3 years and then increase by $500 per year for the machine's 10-year salvage ..
What is the purpose of the finally block : How does a method declare that it can throw an exception? How does it actually throw an exception? Use Java code to illustrate your answer.
What business has being made in dubai : Discuss how Chinese, Japanese,Taiwanese, Vietnamese developin Dubai and how they make growth. How and what business has being made in Dubai by them?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Examine work-related project using systems analysis

Create 4-6-page paper which examines work-related project which used systems analysis for selected business system at department or division level.

  Write and explain the definition of composition in c++

Write and explain the definition of composition in C++ and how it is useful in writing object-oriented programming. Also, explain how it is different from inheritance and how both inheritance and composition are useful in developing object-oriente..

  Write z schemas defining state of the system card validation

Write Z schemas defining the state of the system, card validation (where the user's identifier is checked) and cash withdrawal.

  What is the difference between println and printf

What is the difference between println and printf? Show an example of the usage of each.

  How are these examples of predefined control events

How are these examples of predefined control events and its usage in programming. • Delegate - Object that contains a reference to a method - Encapsulates a method - Provides a way for a program to take alternative courses when running •

  Write a one-page paper describing these new activities

Propose three to five additional activities you think should be added to a Gantt chart to help you estimate resources and durations. Write a one-page paper describing these new activities.

  Differences between technical and technology skills

Describe in scholarly detail differences between technical and technology skills as they associate to telecommunications and how they relate to general expectations

  Develop a technique for machines

For artificial intelligence systems to adapt to new conditions, the 1st task is to construct a technique for machines to resolve problems 'on their own'. To do this, one requires to develop a generic method to resolve generic troubles

  What value would be returned from call to its size() method

If a collection stores 5 objects, what value would be returned from a call to its size() method?

  Explain cause and effect transition happen

One process could cause another process to make a transition. Under what circumstance, if any, would the following. Cause and effect transition happen ?

  Convert decimal number in sixteen bit binary

Convert decimal number +25 and +3 in 16-bit binary. Illustrate your work. Add binary numbers in above question using rules for binary addition.

  Client health-care facilities-information-gathering process

shoulde patients in client health-care facilities participate in the information-gathering process? if so,why , and in what ways should they participate?

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