Generate a list of suggested lottery numbers

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

Questions for C++ Programming

Description:

This assignment will require that you generate a list of suggested lottery numbers using random number generation techniques.  The project will involve passing complex parameters such as arrays, generating random numbers and proper programming techniques. This may be a time consuming project so you may want to get started early and write it a piece at a time. 

Programming Specifications:

  1. The program will prompt the user for the following information:
  2. The number of values to print out ranging from 3 to 7 (inclusive). Any values outside that range must be rejected and the user prompted to enter in correct values.
  3. The range of random numbers to consider. This will be the number of possible values to be selected. This value will range from 1-45 to 1-70 inclusive. You need only prompt for the last number since all lottery values will start with 1.   Any values outside that range will be rejected and the user prompted to enter the correct values.
  4. The number of tickets that you wish to generate from 1 to 100 inclusive. Any value outside the range will be rejected and the user prompted to enter the correct value.
  5. Once a number is selected in cannot be selected again. You must have some method of avoiding duplicate numbers. 
  6. You can assume that valid integers will be entered so you won't need to check for invalid characters or converting numbers.
  7. Output
  8. Echo the information that the user input.
  9. Number of numbers ( number between 3 and 7 inclusive)
  10. Range of Values ( 1 to the largest value)
  11. Number of ticket guesses (number of tickets)
  12. Odds of winning. To estimate the odds of winning you use a formula that uses the highest value and the number of numbers.  So, if you wanted 6 numbers with a maximum value of 55 you would calculate the odds at: N! / (K! * (N-K)!  where N is the highest number and K is the number of balls selected.   55*54*53*52*51*50/ (1*2*3*4*5*6) = 1 in 28,989,675
  13. The numbers produced by your program, one group per line. See Example.

Design Considerations:

  1. Provide an initial seed to your random number generator by pasting the current time to srand. . Be sure to include the <cstdlib> , <ctime>, and <iomanip> and <iostream> libraries. 
  2. Each subsequent call to rand() will cause a new seed to be generated automatically.
  3. The random number generator returns a large integer number which must have the modulo operator used to reduce the possible number of returned values for the range you wish. For instance, if you wanted the upper range of your numbers to be 56 you would use the following statements:

Randomnumber = rand() % 56 +1;

  1. Each number within a ticket can be used only once. Think of the ping pong ball method used on lottery shows where once a ball is selected that number cannot be used again.
  2. Your program must use functions that shows examples of passing parameters and returning values.  

General Requirements:

  1. No global variables, other than constants and type definitions!
  2. Use the const qualifier on member functions wherever it is appropriate.
  3. Your main routine should just mainly handle the calling of functions and basic program structure.
  4. You will need to use the <iostream> library for output and the <ctime> library for obtaining an initial seed and the <cstdlib> for random numbers. You may use the <iomanip> library for formatting your output if you wish.
  5. When you write source code, it should be readable and well-documented.
  6. You must have prototypes for all of your functions.

Reference no: EM133201528

Questions Cloud

Describe the principles of ethical leadership : Define and describe the principles of ethical leadership. Which two of the five covered in chapter, do you think are the most important? Why?
Determine the minimum and maximum parameters : If a legal integer was entered, check its value to see if it is within the provided minimum and maximum range (inclusive). If the user input was within the rang
Name two monetary and two non-monetary ways : AHS 7615 Topics: Administering Faith-based Human Services Assignment - The Monetary and Non Monetary Ways Discussion, Wilmington University
Worthiness of the franchise investment : Do you agree or disagree with your fellow student's conclusion on the worthiness of the franchise investment they selected and the financing option preferred?
Generate a list of suggested lottery numbers : This assignment will require that you generate a list of suggested lottery numbers using random number generation techniques.
Describe ethnocentrism and prejudice : Define culture and explain the terms related to culture. Define and describe ethnocentrism and prejudice. Give personal examples to support your descriptions.
Mips assembler program : You have been given 21t3final_q3. s, a MIPS assembler program that reads an integer value and then prints it. Add code to the file 21t3final_q3.s
Writing a function called process : You run a side hobby of repairing old retro tech. Your business is growing, and you want to add a bit more automation to help your billing system.
Overview of the history of knowledge management : Explain the concept of knowledge management. Provide an overview of the history of knowledge management. (300-400 words)

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a c program that uses functions to perform

Write a C program that uses functions to perform the following: i) Addition of Two Matrices ii) Multiplication of Two Matrices

  Prepare a program for a company named retail-martbullprompt

prepare a program for a company named retail-mart.bullprompt the user to enter an item name one word only a quantity

  Write a function that takes three arguments

Write a function that takes three arguments: the name of an int array, array size, and an int value. Have function set each element of the array to int value.

  Write the definition of a function

Write the definition of a function, isReverse , whose first two parameters are arrays of integers of equal size, and whose third parameter is an integer

  A program that will search a file of numbers of type int

Write a program that will search a file of numbers of type int and write the largest and the smallest numbers to the screen.

  Write file-oriented c program that maintain a list of names

Write an interactive, file-oriented C program that will maintain a list of names, addresses and telephone numbers in alphabetical order (by last names). Process the information associated with each name as a separate record.

  Write a program to create 100 real random numbers

Write a program to create 100 real random numbers and store it into a 1-D array.

  Implement a craps game according to the rules

CptS 121 - Program Design and Development - Write a program that implements a craps game according to the above rules. The game should allow for wagering. This means that you need to prompt that user for an initial bank balance from which wagers wi..

  The definition for a printallplayers() function

Add the Prototype, a call and the definition for a printAllPlayers() function that prints to STDOUT (using cout) each players name and all of their at-bat stats. Only print out the values of the stats array up to timesAtBat.

  Write down program in c for matrix multiplication program

write down program in c for matrix multiplication. program must accept dimension of both matrices to be multiplied and

  Write a c program that adds two input values

Introduction to C programming: Write a C program that adds two input values and outputs the sum and product on the screen.

  Write a program that asks the user to enter a latitude

Write a program that asks the user to enter a latitude in degrees, minutes, and seconds and that then displays the latitude in decimal format.

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