Reference no: EM13698113
Question: You need to make a program to play lottery.
The program randomly generates a Lottery of a three-digit number ( any number from 100 to 999), prompts the user to enter a three-digit number, and determines whether the user wins according to the subsequent rule:
a. If the user matches the lottery in exact order , the awards is $100,000.
b. If the user input matches the lottery digits, the awards is $50,000.
c. If two digit in the user input matches a digit in the lottery, the awards is $30,000.
d. If one digit in the user input matches a digit in the lottery, the awards is $10,000.
Sample solution:
The winning number is 865.
Your ticket is 865 then 100000
Your ticket is 686, or 568,.. all digits are right but not in order
You get 50000
Your ticket is 860, or 186 .. then 30000
Your ticket is 800, 706, 600.. just one digit much you get
10000
Else
0
Please execute the program to check errors. It must compile with no errors and follow the directions. Thank you.
Prepare the pseudo code for given algorithm
: They alternate: dark, light, dark, light, and so on. You want to get all the dark disks to the right-hand end, and all the light disks to the left-hand end.
|
Show that if the statement is true
: Show that if the statement P(n) is true for infinitely many positive integers, and the implication P(n+1) ---> P(n) is true for all n>=1, then P(n) is true for all positive integers.
|
Subsets of cardinality
: Prove by induction that for every n >= 3, any set of cardinality n has exactly n(n-1)(n-2)/6 subsets of cardinality
|
Show what makes database connectivity so complex
: Show what makes database connectivity so complex and what could be done to simplify it - Add in your discussion why it is utilized despite its complexity.
|
Program to play lottery
: The program randomly generates a Lottery of a three-digit number ( any number from 100 to 999), prompts the user to enter a three-digit number, and determines whether the user wins according to the subsequent rule:
|
Use bcd to encode the decimal number
: Find the decimal integer that corresponds to each interpretation and Perform the subsequent operations:
|
Create a floating point variable
: Demonstrate with labels: 1) a math equation using integers and your variables); 2) using one of your variables, each of the assignment symbols
|
Find the proper syntax for plotting the graph
: Find the proper syntax for plotting the graph of |x|+|y|=1 ranging from -1 to 1 - Hint: you do not need to create x and y.
|
2s complement representation
: How would you take a decimal number and make it a word-length 2's complement representation?
|