Write a program that imitates a lottery

Assignment Help Computer Engineering
Reference no: EM13323421

Write a program that imitates a lottery. The program will use two one-dimensional arrays to store the winning numbers and the user's choices. A function will be use to decide whether the user has won or not.

The program should:

  1. Declare two arrays that hold 5 ints
  2. One of the arrays, named winningDigits[],
    • should have elements that are randomly generated integers between the values 1 and 20.
    • The assigning of the elements of the array winningDigits[] should be done in a function void pickwinning(int [], int).
  3. The program should ask the user to enter 5 integers between 1 and 20.
    • Values less than 1 or greater than 20 should not be accepted.
    • The valid input values should be stored in the second int array of 5 elements, pickfive[].
  4. In a function, int compareValue(const int [], const int [], int),
    • the two arrays should be compared element by element.
    • The function counts the number of identical elements and returns this value.
  5. The program should then print out the winning digits, the user's digits and how many elements were a match.

 

Reference no: EM13323421

Questions Cloud

Explain the reaction between trans-2butene+potassium : the reaction between trans-2butene+potassium tert-butoxide+CHCl3 produces which: meso compund or pair of enantiomers. Explain
What is the angular speed of the tire : A car is traveling at 81.9 km/hr. The tires have a radius R = 38.4 cm. What is the angular speed of the tire
Explain what mass of na2co3 will be required to titrate : what mass of Na2CO3 will be required to titrate 75.0 mL of 0.350 M HCl. This is the balanced equation given Na2CO3+2HCl--->2NaCl +H2O+CO2
What is the moment of inertia of a solid cylinder : In each of the following cases, the mass is 7.83 kg and the radius is 7.50 cm. What is the moment of inertia (kg m^2) of a solid cylinder rotating about an axis parallel to the symmetry axis but passing through the edge of the cylin..
Write a program that imitates a lottery : Write a program that imitates a lottery. The program will use two one-dimensional arrays to store the winning numbers and the user's choices. A function will be use to decide whether the user has won or not.
Describe key performance indicators : When establishing a team performance plan what role can the mission statement play - describe Key Performance Indicators and describe the role of feedback in this process or having advice from outside the work team.
Explain what mass of solid fecl3 is required to prepare : A. what mass of solid FeCl3 is required to prepare 250.0 ml of 0.245 M FeCl3 solution. B. How would you prepare 500.0 mL of 0.0500 M FeCl3 solution starting from the above solution in part A
Implement a superclass called appointment and subclasses : Improve your Appointment program by giving the user the option to add new Appointments. The user must specify the type of the appointment, the description, and the date and time.
What was the change in kinetic energy of the bullet : A bullet with mass m = 5.21 g is moving horizontally with a speed v = 373 m/s when it strikes a block of hardened steel with mass M = 14.8 kg, What was the change in kinetic energy (J) of the bullet

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to generate a class diagram for the entity classes

How to generate a class diagram for the entity classes

  What is the best process to dispose of a cell phone

What is the best way to dispose of the cell phone without leaving your personal information out there for someone else to access? In this disposable society, cell phones are good for about 2 years and you buy a new one. The old one usually ends up..

  Process of developing a new inventory management system

Process of developing a new inventory management system. One of the event handling processes in that system is Receive Supplier Shipments.

  Delete an existing product from the database in php

In the PHP scripts you create, refer to the DSN datasource as flamingo. though its not in your own folder or directory, it has been set up as a SYSTEM DSN, so your PHP script would have access to it.

  Solves a system of linear equations

Write a function that solves a system of linear equations or calculates the inverse of a matrix by Gauss-Jordan elimination.

  What are the capabilities of odd parity

How many bits are needed to uniquely represent a code that includes.

  Identify the test objectives and test approaches

A typical download takes one hour, and an interrupted download must be restarted from the beginning. The number of customers downloading at the same time ranges from 10 to 100 throughout peak hours. On average, your system could go down about once..

  How to modify bob''s behaviour to prevent this threat

imagine we are using Lamport's hash, and Bob's system crashes before receiving Alice's reply to a message. Further suppose an intruder, Trudy, can eavesdrop and detect that Bob crashed (maybe Trudy can even cause Bob to crash).

  Visual logic

Consider that you are working with “Visual Logic”. Develop the logic for a program which enables a user to enter the 10 numbers, and then display them in reverse order of their entry.

  File containing a table of student grades

A particular professor has a file containing a table of student grades, where the first line of the file contains the number of students and the number of scores in the table.

  Program to calculate the weight of students

We have run regression analysis along with the resulting estimated regression equation as follows:” the estimated weight equals (-180 pounds) plus (5 pounds times the height in inches).” Write down the program to calculate the weight of students.

  Benefits of firewall

Write down a summary explaining the firewall you installed involve the benefits of firewall you selected.

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