The file winning_numbers.txt contains the winning numbers for the Powerball lottery since the beginning of the year. Below is a partial listing of the file winning_numbers.txt: Drawing Date Winning Numbers Prize 1/1/2022 6 12 39 48 50 7 2 500000000 1/3/2022 2 13 32 33 48 22 2 540000000 1/5/2022 6 14 25 33 46 17 2 630000000 1/8/2022 20 21 36 60 65 13 10 20000000 1/10/2022 14 17 18 21 27 9 2 27000000 1/12/2022 12 21 22 30 33 24 4 38000000 1/15/2022 3 18 37 51 59 13 2 48000000 1/17/2022 9 24 35 46 65 22 2 53000000 1/19/2022 11 15 43 55 61 10 3 62000000 1/22/2022 8 14 33 36 67 17 2 76000000 The winning numbers for the date 1/1/2022 are: 6 12 39 48 50 7 2 The numbers 6 12 39 48 50 are considered the 5 white balls (ping pong balls with numbers on them), 7 is considered the Powerball (color is a red ping pong ball with a number on it), and 2 is considered the Powerball Multiplier. A player of the game wants to know which white balls have been selected with the greatest frequency and which Powerball numbers have the greatest frequency. As an example, using 14 as the white ball from the above data set, 14 has a frequency of 3. For the Powerball number 17 would have a frequency of two.   Write a C++ program to write to a file the frequency of occurrences for the white ball numbers and the Powerball numbers and their frequencies of occurrence. Both lists should be in ascending numerical order. Example of output to a file using the above data set:   White Ball Frequency 1: 0 2: 1 ⋮ 14: 3 Power Ball Frequency 1: 0 2: 0 ⋮ 17: 2

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The file winning_numbers.txt contains the winning numbers for the Powerball lottery since the beginning of the year. Below is a partial listing of the file winning_numbers.txt: Drawing Date Winning Numbers Prize 1/1/2022 6 12 39 48 50 7 2 500000000 1/3/2022 2 13 32 33 48 22 2 540000000 1/5/2022 6 14 25 33 46 17 2 630000000 1/8/2022 20 21 36 60 65 13 10 20000000 1/10/2022 14 17 18 21 27 9 2 27000000 1/12/2022 12 21 22 30 33 24 4 38000000 1/15/2022 3 18 37 51 59 13 2 48000000 1/17/2022 9 24 35 46 65 22 2 53000000 1/19/2022 11 15 43 55 61 10 3 62000000 1/22/2022 8 14 33 36 67 17 2 76000000

The winning numbers for the date 1/1/2022 are: 6 12 39 48 50 7 2 The numbers 6 12 39 48 50 are considered the 5 white balls (ping pong balls with numbers on them), 7 is considered the Powerball (color is a red ping pong ball with a number on it), and 2 is considered the Powerball Multiplier. A player of the game wants to know which white balls have been selected with the greatest frequency and which Powerball numbers have the greatest frequency. As an example, using 14 as the white ball from the above data set, 14 has a frequency of 3. For the Powerball number 17 would have a frequency of two.

 

Write a C++ program to write to a file the frequency of occurrences for the white ball numbers and the Powerball numbers and their frequencies of occurrence. Both lists should be in ascending numerical order. Example of output to a file using the above data set:

 

White Ball Frequency 1: 0 2: 1 ⋮

14: 3 Power Ball Frequency 1: 0 2: 0 ⋮ 17: 2

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education