Design a class that keeps track of a students food


Design a class that keeps track of a student's food purchases at the campus cafeteria. A meal card is assigned to an individual student. When a meal card is first issued, the balance is set to the number of points. If the student does not specify the number of points, then the initial balance is set to 100 points. Points assigned to each food item are a whole number. A student can purchase additional points at any time during a semester. Every time food items are bought, points are deducted from the balance. If the balance becomes negative, the purchase of food items is not allowed. There is obviously more than one way to implement the MealCard class. Any design that supports the key functionalities is acceptable. Write a test application (main program) named MealCardTest that demonstrates class MealCard's capabilities. The problem will have two classes. MealCard is a class definition and MealCardTest is the main class.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design a class that keeps track of a students food
Reference No:- TGS01174688

Now Priced at $30 (50% Discount)

Recommended (96%)

Rated (4.8/5)