Make a program to play lottery

Assignment Help C/C++ Programming
Reference no: EM13168096

 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 following rule:

1. If the user matches the lottery in exact order , the awards is $100,000.

2. If the user input matches the lottery digits, the awards is $50,000.

3. If two digit in the user input matches a digit in the lottery, the awards is $30,000.

4. If one digit in the user input matches a digit in the lottery,

the awards is $10,000.

Sample:

The winning number is 865.

 

Your ticket is 865 then 100000

Your tickect 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 excute the program to check errors Thank you.

I will rate 5 stars if no errors.

 

 

Reference no: EM13168096

Questions Cloud

The computer game function collision : The computer game function collision () checks whether two circular objects collide; it returns True if they do and False otherwise. Each circular object will be given by it's radius and the (x,y) coordinates of it's center.
A firewall works by blocking incoming : A firewall works by blocking incoming requests. Explain how a firewall can distinguish between two incoming requests allowing one while denying the other??
What''s a more efficient way to write : What's a more efficient way to write this function for a matrix? This one has to go through all the numbers, but that would take too long. r_num is row and c_num is column
The stack parameters will not be const reference : In this second case, the stack parameters will not be const reference parameters because they are temporarily changed before being restored. As an alternative, the parameters could be value parameters (so that changing them does not affect the act..
Make a program to play lottery : 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
Expressions until the user says : Expressions until the user says he or she wishes to end the program. For a more difficult assignment, enhance your program so that the expression need not be well formed; if it is not well formed, then the user is asked to reenter the expression.
State and name the four general types of carbonyl reactions : name the four general types of carbonyl reactions. give an example of each including a detailed mechaism. use a propyl group next to a carbonyl in each example.
The program will read integers values : Write a C++ program to do the following. The program will read integers values one at a time from standard input (cin) until you read the value 150. assume that the number of values read in is at least 1 and less than or equal to 100
Create a function in c++ that subtracts two vectors : Create a function in c++ that subtracts two vectors. The function returns a vector than can also be negative.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Execute tests and repetitions

Read data from standard input and store them in an array, Execute tests and repetitions

  Recursive function

What is the result of the following recursive function when called with mm(10)? Write out the execution trace of this call to mm(10).

  The use of decision logic

The use of decision logic is one of the major concepts of computer programming.

  Asks the user for the name of an input file and translates

Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your  main  function should be responsible for reading the input file and coordinating calls to a value-returning functio..

  A palindrome is a number

A palindrome is a number or text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 34543 and 11611. Write a program that reads in a five-digit integer and determines ..

  The main program should create an ifstream

For decryption, the main program should create an ifstream for the file to be decrypted. It should use the getline method of the ifstream to read lines from the file, call the encryption / decryption function with the line to be decrypted, and dis..

  Use the convention that all years have 360 days

In writing the days() function, use the convention that all years have 360 days and each month consists of 30 days. The function should return the number of days for any Date structure passed to it. Write a main () function to test your function.

  Dynamically allocates an array large enough

Write a program that dynamically allocates an array large enough to hold a number of test score. The size of the array should be input by the user

  Two types of sporting teams

Select two types of sporting teams and de?ne subclasses for them. These classes shouldinherit from a base team class such as that created in Exercise 1. Include uniquecharacteristics about the sport.

  A file (complex.txt) which has a number of complex numbers

Read in a file (complex.txt) which has a number of complex numbers in the form of a+bi (e.g. 3+5i  2-3i etc).

  Calculates different formulas that converge to the number pi

Write a C program (Care should be taken not to use extensions of C + + language in your work ) that calculates different formulas that converge to the number  pi,  to compare the speed of convergence of these formulas. Each form will be calculated by..

  Describe an example application of polymorphism

Provide and describe an example application of polymorphism that could be used in a program solution. List and describe the class relationships.

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