UnitThreeAssignment.java - For the unit 3 assignment you must develop a program that reads the file icecream.dat This file is supplied in the directory

UnitThreeAssignment.java - For the unit 3 assignment you...

This preview shows page 1 - 2 out of 2 pages.

/* For the unit 3 assignment, you must develop a program. that reads the file icecream.dat. This file is supplied in the directory in Unit 3. 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. Note: To do this program, you have to know when to stop reading from the file. TextIO has a function named TextIO.eof() to check whether the entire file has been read. The value of this function is true if the entire file has been read. The value is false if there is more data in the file. You want to continue reading from the file as long as TextIO.eof() is false. Note: Suppose that flavor is a variable of type String and you want to test whether its value is "Strawberry".
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Spring '16
  • mohamed attia
  • ice cream, Ice cream cone, 1.4G, TextIO

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes