[solved]-C Csci 1010 Programming Assignment Count Basketball Jersey Numbers Turns Pattern Numbers B Q38996369
C++ CSCI 1010 Programming Assignment: Count the basketballjersey numbers It turns out there is a pattern to the numbers onbasketball jersey numbers. The digits are always 0 to 5. You’llnever see a 6, 7, 8, or 9 in a jersey number. We need you to writea program to report how many values in a value are not basketballjersey numbers. In this assignment, you will be creating a programwhich reads in a file called input.txt. The first line in the filecontains an integer of how many subsequent values are in the file(call this number �). The next � numbers are doubles. Count thenumber of basketball jersey numbers. A file containing only a 0means that there are no values to average. Instead of printing theaverage of no values, display that the file has no values toaverage. The program should not crash under these circumstances.Instead, it should display an error message and exit gracefully.You can make your own input.txt file in Notepad or Notepad++. (Ifyou’ve never used Notepad++, you should download it and try it.It’s a fast and versatile file editor that programmers will use ona daily basis. And it is free.) My solution is 44 lines of code.Basketball Jersey Numbers From Wikipedia: American basketballleagues at all levels traditionally use single and double digitsbetween 0 and 5 (i.e. 0, 00, 1–5, 10–15, 20–25, 30–35, 40–45, and50–55). The NCAA and most amateur competitions mandate that onlythese numbers be used. This eases non-verbal communication betweenreferees, who use fingers to denote a player’s number, and theofficial scorer. In college basketball, single-digit players’numbers are officially recorded as having a leading zero. Teams canhave either a “0” or “00”, but they cannot have both. For thepurpose of this assignment, assume that “00” isn’t a legal jerseyvalue. Your objective is to write a program which will count thenumber of basketball jersey numbers. • 0-5 • 10-15 • 20-25 • 30-35• 40-45 • 50-55 Learning Outcomes • Use a ifstream in the fstreamlibrary to open a file. • Handle the runtime event of a filecontaining no values. Instructions Filename:FirstnameLastnamePass06.cpp Here are the steps you should take tocomplete this assignment. 1. Include the iostream and the fstreamlibrary. 2. Create the following variables. – numValue (int). Setthis to 0. – count (int). Set this to 0. – value (int) – inFileName(ifstream) 3. Open the file. 4. If the file can be opened. 1. Readin the first integer. 2. If this integer is not 0, 1. Using a forloop… 1. Read in each value into value. 2. If the value is abasketball jersey number, increment count. 2. Display the count andthe number of all values inspected. 3. Else, display that therewere 0 values in the file. 5. Else, display that we are unable toopen the file. This program has no input prompts. It will look fora file within the project to open. If it finds it, it will proceed.If it cannot, it will display an error message. Requirements Yourprogram should handle the following circumstances. • input.txt isnot found. • The file begins with a 0. • The file contains nodata.
Expert Answer
Answer to C++ CSCI 1010 Programming Assignment: Count the basketball jersey numbers It turns out there is a pattern to the numbers… . . .
OR