Question
You must use TextIO methods to read the file. As you read the file, count the total number of ice cream cones that were sold.
You must use TextIO methods to read the file. As you read the file, count the total number of ice cream cones that were sold. (This is the same as the number of lines that you read from the file.) Also count the total number of "Strawberry" cones that were sold.
At the end of the program, print out the total number of cones, the number of Strawberry cones, and the percentage of cones that were Strawberry.
Each line of the file icecream.dat is an ice cream flavor such as "Vanilla" or "Strawberry." A line represents the sale of one ice cream cone of the given flavor.
You must complete program, test, debug, and execute it. You must submit your java code file. The output of your program must be captured by either copying the content in the output window and pasting it into a text document that you submit along with your java code file, or by capturing the image of the screen which contains the output of your java program. In windows you can capture a screen shot with theCtrlAltandPrint Screen keysequence. This image can then be pasted into a Word, WordPad, or OpenOffice document which can be submitted with your assignment.
For students using the program service online, make sure that you create both the TextIO.java and the icecream.dat files as java project files. I found it was easier to rename icecream.dat to icecream.txt for some reason. For students using Netbeans, use the same set of rules that were defined in Unit 2 to setup your project and include the TextIO.java file. Also make sure that you copy the icecream.dat file into your project directory so that it can be found by your java program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started