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

  Grocery store program

This program draws upon several concepts that were covered in CptS 121 and should serve as a good refresher for CptS 122. Our store, Cougar Mart, maintains its inventory in a text file. Not being very tech savvy, the owner of Cougar Mart needs you to..

  Write program which reads n numbers from keyboard

Write down C++ program which reads N numbers (positive, negative, integer and double numbers) from keyboard, computes and shows the following information. Largest number of all numbers entered from keyboard.

  Build a table of reynolds numbers at flow velocities

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Write a program in c of fibonacci series

Write a program in c of fibonaci series with and without using fibo func, both

  Counts all occurrences of a given string from such a bag

Write a C++ function that removes and counts all occurrences of a given string from such a bag.

  Write a function that computes length of a character string

Write a function that computes the length of a character string (i.e. write your own implementation of the strlen function.

  Write program to input series of hourly temperatures

Create and write a c++ program which inputs series of 24 hourly temperatures from file, and outputs bar chart (using stars) of temperatures for the day.

  Determine order in which constructors of class will execute

Suppose that an object of class three enters its scope, so the constructors of theses classes will execute. Determine the order in which the constructors of these classes will execute.

  Make a class employee

Make a class EMPLOYEE with a name and salary. Make a class MANAGER inherit from EMPLOYEE. Add an instance field, named DEPARTMENT

  Print out the sum of all numbers, the average

Write a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is attempting to read

  Design customized mailing lists for marketing department

Marketing department requires to be able to design customized mailing lists, to send different messages to different types of donors. What system will best meet these requirements?

  Write short c program to develops two processes

Write down a short C program which develops two processes. Each process must repeatedly write its own unique message to test file, one character at time. Do you see garbled messages in the file? Explain why or why not?

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