Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on all this information, please review the BruinCard class diagram shown below: The BruinCard class has a MealPlan data member (named mPlan) and includes

image text in transcribed

Based on all this information, please review the BruinCard class diagram shown below: 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 1111 or 1114 or 1119 ) 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. For this project, you will create a file named Enums.h and then both a .h and .cpp for the two classes. Write some sample driver code in your main( ) and create assertions to verify that your accessor methods are all working properly. Some sample code is shown below to further document how this class should work. You should be guarding your .H files as shown in class to ensure they can be properly included by anyone who uses them

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

Step: 3

blur-text-image

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions