Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The BruinCard class has a MealPlan data member (named mPlan ) and includes a boolean data member (named mBoughtAMealPlan ) to track whether a MealPlan

The BruinCard class has a MealPlan data member (named mPlan) and includes a boolean data member (named mBoughtAMealPlan) to track whether a MealPlan has been purchased by this BruinCard holder.

The operations purchaseMealPlan( ... ), hasPurchasedMealPlan( ) and getPlan( ) work with these two data members accordingly. It might be the case that a BruinCard chooses not to buy any MealPlan.

When no MealPlan exists for BruinCard, calls to .eat( ... ) should always return false.

A BruinCard with a MealPlan that is used to .eat( ... ) will reduce the available number of meals left this week which is being tracked in the data member howManyMealsLeft.

BruinCards with Premier plans can be used multiple times at the same meal as long as there are available meals left in the plan.

BruinCards with Regular plans can only be used once at any specific meal on any single particular day.

The four boolean data members hasEatenBreakfast, hasEatenLunch, hasEatenDinner and hasEatenBrunch are used to track which meals have been eaten so far each day.

Premier plans provide all their meals (to either 11*11 or 11*14 or 11*19) into the howManyMealsLeft data member when startQuarter( ) is called. With calls to newWeek( ), Regular plans reset howManyMealsLeft (to either 11, 14 or 19) and any leftover meals are not carried forward. With calls to newDay( ) and newWeek( ), the four boolean data members hasEatenBreakfast, hasEatenLunch, hasEatenDinner and hasEatenBrunch should all be reset to false.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions