Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I please have the flowchart, pseudocode,test code and cpp code for the following c++ program using visual studio: (PLEASE INCLUDE THE FLOWCHART) Concepts tested

Can I please have the flowchart, pseudocode,test code and cpp code for the following c++ program using visual studio: (PLEASE INCLUDE THE FLOWCHART)

Concepts tested by the program:

Working with arrays Using file operations Using a selection sort to sort an array Using a function to display arrays Using a function to save arrays to file Implementing functions besides function main()

Project Description

Can you legally gamble? Are you 21 years old or older? Do you know Powerball? Dont worry. You are not going to play Powerball but create a simulated game just like that :)! Go find the rule and study it so that you know how to design and code your program accordingly. Go ahead, search the Internet!

Do you see that your program basically just needs to randomly generate 6 numbers for the user to guess and calculate the prize depending on how many numbers are guessed correctly? Develop a C++ program using random number generator, i.e. rand(), function(s), and array(s) for it!

Project Specifications

Input for this project:

Game mode choice self_pick or auto_pick Five numbers between 1 and 69 (if game mode is self_pick) One number between 1 and 26 (if game mode is self_pick)

Output for this project:

Game title Game rule Game result including

Prize Sorted users numbers Sorted winning numbers

Programmers full name Project number Project due date

Processing Requirements

Define all functions after main function and prototype them properly. Use published PowerBall Prize rule for single draw. [https://www.powerball.com/games/powerball] Set Grand Prize as $1,000,000,000.00 in the program. Create and use five functions for the following:

Function randomly generates and returns a number within the range passed/specified by arguments: max and min. Function sorts a passed array using selection sort. Function saves sorted wining numbers to a data file with a timestamp. Be sure to save the numbers in a way separate groups of numbers can be differentiated. [Hint: this function should call/use above two functions.] Function gets and validates users numbers, saves and sorted the numbers in an array. The sorted array needs to be returned/passed out by this function. This function accepts one argument: game mode choice. Function displays a passed array.

[NOTE: you can create and use more functions if you want, and do not leave out the flowchart and pseudocode]

Sample Screen Output #1:

image text in transcribed

Sample Screen Output #2:

image text in transcribed

Sample Screen Output #3:

image text in transcribed

Number Guessing Game 1. Select FIVE numbers from 1 to 69 for the white balls. 2. Select ONE number from 1 to 26 for the red Powerball. 3. Prize determined by how many of your numbers match the winning numbers Do you want to self pick your white ball numbers (Y or N)): Y Enter number 1 (between 1 and 69):3 Enter number 2 (between 1 and 69):14 Enter number 3 (between 1 and 69):22 Enter number 4 (between 1 and 69):35 Enter number 5 (between 1 and 69):41 Do you want to self pick your red ball number (Y or N)): Y Enter POWEBALL number (between 1 and 26):25 Game Report You won 7.00 points for the game. Here are your numbers: 3 14 22 35 41 25 Here are the winning numbers: 14 41 51 54 59 25 NOTE: The last number is the Power Ball number!!* Thank you for using my program!! PROGRAMMER: Tina Lee CMSC140 Common Project 5 Due Date: 12/1/2818 Program ended with exit code: Number Guessing Game 1. Select FIVE numbers from 1 to 69 for the white balls. 2. Select ONE number from 1 to 26 for the red Powerball. 3. Prize determined by how many of your numbers match the winning numbers Do you want to self pick your white ball numbers (Y or N)): N Do you want to self pick your red ball number (Y or N)): Y Enter POWEBALL number (between 1 and 26) :14 Game Report You won 0.00 points for the game. Here are your numbers: 31 46 50 59 65 14 Here are the winning numbers: 37 39 46 52 55 25 NOTE: The last number is the Power Ball number!! ** Thank you for using my program!! PROGRAMMER: Tina Lee CMSC148 Common Project 5 Due Date: 12/1/2018 Program ended with exit code: 8 Number Guessing Game 1. Select FIVE numbers from 1 to 69 for the white balls 2. Select ONE number from 1 to 26 for the red Powerball 3. Prize determined by how many of your numbers match the winning numbers Do you want to self pick your white ball numbers (Y or N)): Y Enter number 1 (between 1 and 69):0 Enter number 1 (between 1 and 69):-4 Enter number 1 (between 1 and 69):2 Enter number 2 (between 1 and 69):10 Enter number 3 (between 1 and 69):35 Enter number 4 (between 1 and 69):41 Enter number 5 (between 1 and 69):100 Enter number 5 (between 1 and 69):69 Do you want to self pick your red ball number (Y or N)) 3 Do you want to self pick your red ball number (Y or N)) n kGame Report* You won Here are your numbers: n 0.00 points for the game 2 10 35 41 69 9 Here are the winning numbers: 9 21 25 28 59 13 NOTE: The last number is the Power Ball number!! Thank you for using my program! PROGRAMMER: Tina Lee CMSC140 Common Project 5 Due Date: 12/1/2018 Program ended with exit code

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 Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

Students also viewed these Databases questions