Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide the c++ code based on the given UML, main, text file, output and instructions. Thank you!! Also, could you explain what i need

Please provide the c++ code based on the given UML, main, text file, output and instructions. Thank you!! Also, could you explain what i need to do with the .txt file to get it in my program (how to store it in the directory i think is what I am trying to say?)

image text in transcribedimage text in transcribed

TEXT FILE: Novemberdata.txt

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

MAIN main.cpp

const int MAX_SIZE = 100;

const double COST_PER_DOZ = 1.29;

const double COST_PER_SINGLE_EGG = .12;

int main()

{

int numCustomers;

EggOrder customers[MAX_SIZE];

string fileName;

cout

cin >> fileName;

fileName = "novemberData.txt";

// Loads all of the customers into the array

numCustomers = loadArray(customers, fileName);

// Sorts all of the orders by customer name

sortOrders(customers, numCustomers);

// Prints all customer orders in the array

// Also prints the amount of each customers

// order using the constants that are

// declared

printOrder(customers, numCustomers);

}

UML is given to the right Declare this constant at the top of the header file: const int DOZEN 12 EggOrder -customerName: string -numDoz: int -numExtra: int Function Descriptions or Assigns values to the fields. Notice the one with just one formal parameter will have to do some calculations +EggOrder0 +EggOrder(name:string, numDoz:int, numExtra:int) +EggOrder(name:string, totalEggs:int) setters +setCustomerName (name:string):void Sets the attributes to the value setNumDoz(numDoz:int):void passed in. +setNumExtra(numExtra:int): void getters Return the e appropriate attributegetCustomerNameO:string getNumDozO:int getNumExtraO:int computes and returns the total number of eggs getTotalEggsO:int Once you have the class working and have tested it continue to the next part Main Function A main function has been given as well as a data file. You are to write functions that are called by the main function. Output is given on the following page

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

Students also viewed these Databases questions