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

  Probability of occurrence of four pairs in original sequce

What is the probability of occurrence of each of the four pairs in original sequence? Illustrate your work. What is the probability of occurrence of 0 and 1 in modified sequence?

  What are some uses for wrapper classes

Wrapper classes are classes that surround primitive types with additional functionality. What are some uses for wrapper classes? Show some examples of how they could be used.

  How long will it take to reach steady-state value

Investigate the effect of the parameter b on y(t). To do this, plot y versus t for several values of b on the same plot. How long will it take for y(t) to reach 98 percent of its steady-state value?

  Why motherboard sometimes support more than one speed

Why does motherboard sometimes support more than one system bus speed? So that it can support different processors running at different speeds.

  Consider the following code fragment

Consider the following code fragment: for (int i = 0; i = 0; j--) { System.out.println(i + " " + j); } } How would i revise this fragment to output this: 0 0 1 1 1 0 2 2 2 1 2 0 3 3 3 2 3 1 3 0

  Explain what occurs if instruction going through pipeline-lb

Consider processor with six stages: IF(instruction fetch), DA(instruction decode), CO(calculate operands addresses), FO(fetch operands), EX(instruction execution), WB(write results). Explain briefly what occurs in each stage when instruction going ..

  Describe how will tsp work

How will TSP work? Transit planners require to ask questions like: First step is to assess requirement for TSP There are a variety of methods for conducting Needs Assessment.

  Perform the usual operations on circle

You should be able to perform the usual operations on the circle, such as setting the radius, printing the radius, calculating and printing the area and circumference.

  Comparing accuracies using test options

Compare the accuracies obtained using the three "test options": "Use training set", "cross-validation" and "percentage split".

  Write down sructured english for clyde-s narrative

On a trip lasting more than one day, we permit hotel, taxi, and airfare also meal allowances. Same times apply for meal expenses. Write down sructured English for Clyde's narrative of the reimbursement policies.

  Using wireshark note the ip address and tcp port number

Using wireshark note the IP address and TCP port number used by your client computer (source) to transfer the file to any FTP server?

  Write a c++ program that calculates distance of a golf ball

write a C++ program that calculates the distance of a golf ball fallen in with each one-seconds interval drop from airplane calculate the distance in the current time Interval (ft) and total distance the golf ball falls at the end of each interval..

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