Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

on c# no java http://www.powerball.com/powerball/pb_prizes.asp Finish off the Po

ID: 3797004 • Letter: O

Question

on c# no java

http://www.powerball.com/powerball/pb_prizes.asp

Finish off the Powerball application.

Pseudocode:

Start
Enter Winning Number
Enter Number of Numbers Purchased
For each purchase:
    Enter the number into array
For each number in array:
    For each value of number:
        Compare to winning #
            If match
                (6th) || ((1-5)+6th) = $4** if (PowerBallMatch(arr1,arr2) || (NumberMatch(arr1,ar2) == 1 && PowerBallMatch(arr1,arr2))                
                ((2x(1-5))+6th) || (3x(1-5)) = $7 ** if ( (NumberMatch(arr1,arr2)==3) || PowerBallMatch(arr1,arr2) && NumberMatch(arr1,arr2) == 2))                 
                ((3x(1-5))+6th) || (4x(1-5)) = $100
                ((4x(1-5))+6th) = $50,000
                (5x(1-5)) = $1,000,000
                All match = Grand Prize
                Increase prize
Display results

Explanation / Answer

Below is the eample :

#include <iostream>
const int SZ = 10;

int main()
{
    int arr[SZ];
    int Largest = 0, index = 0;
    cout << "Please enter " << SZ << " integers:" << endl;
    for (int i = 0; i < SZ; i++)
    {
        cin >> arr[i];
    }

    for (int i = 0; i < SZ; i++)
    {
        if (arr[i] >= Largest)
        {
            Largest = arr[i];
            index = i+1;
        }
    }
    cout << "Largest number = " << Largest << ", at index: " << index << endl;

    return 0;
}