Question: In c++ please show what code is for what file and what file to run the code from im confused and how to call the

In c++ please show what code is for what file and what file to run the code from im confused and how to call the codes from other files

Provide an implementation of the egg carton class described below. Develop test code that tests your implementation (edge cases should be covered). You should have three separate source code files similar to exercise 1.

+----------------------------------------------------------------+

| | | EggCarton | | |

+----------------------------------------------------------------+

| | | data fields:

| | - brownEggs : int

| | - whiteEggs : int | | |

+----------------------------------------------------------------+

| | | member functions: | |

+ EggCarton() //set initial values to 0 and 0 | |

+ EggCarton(brownEggs : int, whiteEggs : int) | |

// set initial values to 0 and 0 if the total number | |

// of eggs is larger 12 | |

+ addBrownEggs(n : int) : bool | |

+ addWhiteEggs(n : int) : bool | |

+ getTotalEggs() : int | | |

+----------------------------------------------------------------+

Figure 1

The class structure for the EggCarton class is shown in Figure 1. Instances of this class represent egg cartons that can hold up to 12 eggs. The class provides functions to add white and brown eggs. All of the functions that modify the number of eggs in the carton return false if the operation cannot be done exactly as requested. For example, if there are 3 white eggs and 0 brown eggs, then addBrownEggs(10) returns false and the number of white eggs remains at 3 and brown eggs at 0. There is a member function called getTotalEggs, which returns the total number of white and brown eggs together. For example, if the carton has 1 brown and 2 white eggs, then getTotalEggs returns 3. (Appropriate function comments are expected for all functions.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!