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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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