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

  Explain two standard apis supported by jaxp

Explain two standard APIs supported by JAXP (Java API for XML processing) and give a comprison between two mechanism.

  Calculate and display height and cost of container

Compute and display the height and cost of the container. Use the following formulas, where V is the volume, r is the radius, h is the height, and C is the cost.

  How many strings will be read

You should read a list of strings from a data file (using scanf), and find the minimum and maxium values of the string data. The input file format will start with a single integer that indicates how many strings will be read, and then lists those ..

  Rbocs in mfj to retain control of yellow pages

One way to provide additional revenues for the RBOCs in the MFJ was to retain control of the Yellow Pages.

  Design a dtack circuit that will generate the correct number

Assume the processor has a clock period of 5ns and the memory chips' access time is 58 ns. Design a DTACK circuit that will generate the correct number of wait states.

  Relationship between squared biases and variances

Assume we have sample of N pairs xi, yi drawn i.i.d. from distribution characterized as given: xi ∼ h(x), design density. Illustrate relationship between squared biases and variances.

  Explain company-s business intelligence products and service

Go to IBM.COM discover all company's business intelligence (BI) products and services Explain their process in minimum of half page to full page.

  Random numbers

Create a program that will generate a list of 200 random numbers (ranging from 1- 1000) and determine the medium, mode, and average of the list of numbers. Have the program display the original list and then display the list in ascending and desce..

  Explain how entities are transformed into tables

5.1-Explain how entities are transformed into tables?

  What is the minimum required frame length for this ethernet

Assume that two nodes in a 10Mbps Ethernet cable are 1200 meters apart. Also assume that the signal propagation speed is 2 x 10 8 meters/second. What is the minimum required frame length for this Ethernet?

  Compare iso-iec outline with nist documents

Compare the ISO/IEC 27001 outline with the NIST documents outlined in 'Management of Information Security' (by Michael E. Whitman, Herbert J. Mattord).

  Storage of an unordered collection of items

Storage of an unordered collection of items that facilitates efficient, random access of items based on an item's position in the collection.

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