(Solved) : Using Uml Create Class Called Eggorder Eggorder Customername String Numdoz Int Numextra In Q42735978 . . .

Using the UML below, create a class called EggOrder.

-customerName: String
-numDoz: int
-numExtra: int
+EggOrder(name: String, numDoz: int, numExtra: int)
+EggOrder(name: String, totalEggs: int)

// not implementing sets due to time



NOTE: test methods as you implement them

  • Implement the constructors The default constructor should setname to an empty string and the ints to 0. (notice – due to time,you do not have to worry if they are negative or invalid) Alsonotice that – one constructor is a conversion constructor. Thatmeans that the formal parameter is NOT a field of the class, youmust use math to convert the formal parameter to the fields in theclass.
  • Implement the get methods -Test the class so that it workscorrectly

Once you have the class working

  • Create a text file. Copy the data below into the file. Save thefile as novemberData.txt.

Mickey 186 Minnie 274Donald 84Goofy 841Daisy 178Cinderella 387SnowWhite 718Aurora 2074Ariel 478

Write the methods in the main.cpp file given below, followingthe comments.


#include <iostream>#include <fstream>#include <string>#include <iomanip>#include “EggOrder.h”using namespace std;// prototypes int main() { EggOrder novemberOrders[100]; int numElements; string filename; cout << “Enter the name of the file: “; cin >> filename; numElements = fillArray(filename, novemberOrders); printReport(novemberOrders, numElements); return 0;} // fillArray method // This method opens the file that is passed in and loads it into the array, it // makes sure it opens correctly. If it doesn’t open correctly, it should // print the message “File not found” and then exit the program. The method // will then read the information from the file and create an Eggorder object // put it into the array. The method returns the number of orders that were // read in // printReport // Prints the report as shown in the Sample Output

Sample Output

Enter the name of the file: novemberData.txt (make sure there is a blank line at the endName Dozens Individuals Total EggsMickey 15 6 186Minnie 22 10 274Donald 7 0 84Goofy 70 1 841Daisy 14 10 178Cinderella 32 3 387SnowWhite 59 10 718Aurora 172 10 2074Ariel 39 10 478Total eggs sold this month: 5220

please use c++ for this

Expert Answer

Answer to Using the UML below, create a class called EggOrder. EggOrder -customerName: String -numDoz: int -numExtra: int +EggOrde…

Leave a Comment


We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?