The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
This project needs to be done with C++
Project 1: Fuller Mailbox
I have provided you with a sample class named Mailbox which has been diagrammed below. You can acquire the source to the Mailbox class by clicking on the link for your development environment ( VS2012 XCode5 ). Using the Mailbox class provided earlier, upgrade the class so that it supports various operators. Make operator+ combine together the contents of two Mailbox, as long as the contents does not exceed the size. Make operator- subtract one Mailbox contents from another, as long as the size or contents don't go negative. Support the >> and << operators to allow instances to be read from cin or written to cout. Make the boolean operators <, >, <= and >= test Mailbox's contents. Make the boolean operator == and != test all of the data members of a Mailbox for an exact match.
| Implementation Details | Sample Driver | |||
|
Mailbox yours( "your address" ); yours.setSize( 10 ); yours.deliverMail( 5 );
|
|||
| Â | Sample Output | |||
| Â | CanA????1t A????1 and wind up with a negative contents! 11 pieces of mail in this mailbox test is bigger test is bigger or equal yours is smaller yours is smaller or equal yours != test! equal test works |
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll