Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Power Ball selects 5 numbers in the range 1-69, inclusive, and one number in the range 1- 26, inclusive, as the power ball. The 5

image text in transcribed

Power Ball selects 5 numbers in the range 1-69, inclusive, and one number in the range 1- 26, inclusive, as the power ball. The 5 numbers cannot have any repeat numbers. Once the 5 numbers are selected, they are displayed in ascending order. Write a program that generates a lottery number picker. Your program will have the following functions: vector int> getNumbers(); getNumbers() generates and stores the 5 lottery numbers in a vector. The vector of lottery numbers is returned. The 5 lottery numbers should be in ascending and order. This function is responsible for making sure there are no duplicate numbers in the vector void setPowerball(vector &); setPowerball(vector &) takes a reference parameter to the vector of lottery numbers. This function generates the power ball number adds it as the last element in the vector of lottery numbers. void showNumbers(const vector& v) showNumbers(const vector int>& v) displays the lotto numbers in the vector as shown in the sample dialog (below). A main function that Asks the user how many lottery numbers they would like to see o Display the requested numbers o Offer the user a chance to generate more

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions