Please Draw Flow Chart A company has an unknown number of em

Please Draw Flow Chart

A company has an unknown number of employees.The company decided to help employees to overcome their budgeting problem as follows:

Each employee gets extra money based on the age of their dependents, if age of child is less than six, company pays $50 for each year of the child age, if age of child is less than ten, company pays $30 for each of the child age, otherwise company pays $20 for each child over ten. Write a C++ program that prints each employee’s name, number of child/children and at end of program print total extra money company paid to the employees.

Solution

#include #include #include using namespace std; class factory // Class for factory scenario { public: char Employee[256]; string EmChild[128]; // Child Name { array because of the possibility of} int EmChAge[128]; // Child Age { multiple children } int discount; }; class grocery // Class for shopping scenario { public: char Customer[256]; double PriceTag; // Sub-Total double FPriceTag; // Final Price int Discount; }; class library // Class for Library scenario { public: char Customer[256]; double PriceTag; double FPriceTag; double Discount; char BookName[256]; // Multiple books double BookPrice[256]; int books; int Discount_F,Discount_S,Discount_B; }; void factoryCalc() { factory Discounts[1024]; int children,ChildAge,I = 0; char ChildName[256]; string EmName; for(int i = 0;i < 1024;i++) { cout << \"Enter employee name: \"; cin.getline(Discounts[i].Employee,256); cin.getline(Discounts[i].Employee,256); EmName = Discounts[i].Employee; if(EmName == \"Quit\") // To quit { break; } cout << \"Enter number of children: \"; cin >> children; for(int j = 0;j < children;j++) { cout << \"Enter child \" << j + 1 << \"\'s name: \" << endl; cin.getline(ChildName,256); cin.getline(ChildName,256); Discounts[i].EmChild[j] = ChildName; cout << \"Enter child \" << j + 1 << \"\'s age: \" << endl; cin >> ChildAge; Discounts[i].EmChAge[j] = ChildAge; if(ChildAge < 6) { Discounts[i].discount += 50; } else if(ChildAge < 10 && ChildAge > 6) { Discounts[i].discount += 30; } else { Discounts[i].discount += 20; } } I++; } cout << endl << endl; for(int i = 0;i < I;i++) { cout << \"Employee Name: \" << Discounts[i].Employee << endl; cout << \"Number Of Children: \" << children << endl; for(int j = 0;j < children;j++) { cout << \"Child \" << j + 1 << \": \" << Discounts[i].EmChild[j] << endl; cout << \"Age: \" << Discounts[i].EmChAge[j] << endl; } cout << Discounts[i].Employee << \"\'s discount: $\" << Discounts[i].discount << endl; cout << \"-----------------------------------\" << endl; } cout << endl << endl; }
Please Draw Flow Chart A company has an unknown number of employees.The company decided to help employees to overcome their budgeting problem as follows: Each e

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site