CS 1054 Introduction to Programming in Java (Spring 2008)

Project 2: Ice Cream Stations (Version 2)

Instructions

  1. Rewrite your IceCreamStation class so that it now guards against insufficient cash or ingredients during its buy and sell actions. In addition, arrange it so that IceCreamStation objects can be created with varying initial cash. In particular, Here is an updated Java documentation page for IceCreamStation.
    Important: For this version, make sure your "magic numbers" (i.e., the price of a box of cones, the number of cones per box, the price of a pint of ice cream, and the amount of ice cream per ice cream cone) are all declared as constants (final variables).
  2. Testing: Write a revised IceCreamTester so you could test your new and improved methods. For instance, try the following: You do not need to submit your tester file.
  3. Submission: submit IceCreamStation.java through http://web-cat.cs.vt.edu as you did before. This project is due on Monday, March 10 (11:59pm), but webcat will be accepting submissions as early as Thursday, Feb 28. Go to the Commenting section of your web-page for a guideline on how to write comments for the class, constructor, and methods.
  4. Optional (no submission required). To prepare you for your next project, add an IceCreamStationConsole class to the BlueJ project that contains IceCreamStation; cut and paste this code . Study how this program works.