Define? a? class? Entrepreneur? as? an? ADT? that? uses? separate? files? for? the? interface? and? theimplementation.? The? class? represents? a? group? taking? part? in? an? entrepreneur? day? at? school.? please refer to attachment for question details
Define a class Entrepreneur as an ADT that uses separate files for the interface and the
implementation. The class represents a group taking part in an entrepreneur day at school.
This class has the following data members:
// the item that the group is going to sell
// the number of members in the group
double Donation; // the donation amount received by the group
double StartupAmt; // the startup amount given to the group
double Expenses; // the expenses to buy/make items/products
double Income; // amount from sales
double Profit; // profit amount : Income +(StartupAmt+Donation)
// - Expenses
// points allocated to group
// indicate whether all items/products were
// 1 = all sold, 0 = all not sold
The class should contain a default constructor that initializes Item to "Not decided",
Nr to 1 and Donation, StartupAmt, Expenses, Points, Income and Sold to 0.
It should also contain an overloaded constructor that accepts nine parameters to set the
member variables to specified values. The destructor should output "Congratulations
to all groups that partook in the challenge!"
Include accessor functions that return the values stored in the member variables of an
object of class Entrepreneur (i.e. get functions), as well as mutator functions to update
each of the member variables of an object of class Entrepreneur respectively (i.e. set
functions with a parameter to set each member variable to a value specified by the
In addition the class also have member functions set_info(), calc_profit() and
update_points(). Function set_info() sets the values of member variables
Expenses, Income and Sold, according to user input values. Function
calc_profit() calculates a group?s profit as follows: profit = income + (startup amount
+ donation) ? expenses; and updates the member variable profit. Function
update_points() calculates the points for a group as follows: 1 point if the group has
less than 3 members, and 2 points otherwise; 1 point if no donation was received; and 1
point if all items were sold; and updates the member variable points accordingly.
Overload the comparison operator > as a friend function for class Entrepreneur. This
function returns true if the Points member variable of Group1 is bigger than that of
Group2, or if the Points member variable of Group1 is equal to that of Group2 and the
Profit member variable of Group1 is bigger than that of Group2. Otherwise the
function returns false. Use the following prototype:
bool operator>(const Entrepreneur & Group1, const Entrepreneur &
Overload the stream extraction operator >> and the stream insertion operator << as
friend functions for class Entrepreneur. The stream insertion operator << should
display the item, number of members in the group, startup amount, donation amount,
expenses, points earned and whether all items were sold or not. The stream extraction
operator should get the item to be sold, the donation amount received, the number of
members in the group and the startup amount from the user.
Test your class by writing an application program to do the following:
? Use the overloaded constructor to instantiate objects Group1 and Group2 of class
Entrepreneur by initialising member variables Item, Nr, Donation and
StartupAmt as follows:
Nr Donation StartupAmt
Group1 Cakes 2 R0
Group2 Pizzas 4 R150
? Use the default constructor to instantiate an object Group3 of class
? Use the overloaded stream extraction operator >> to get values for member
variables Item, Nr, Donation and StartupAmt for object Group3 as follows:
Nr Donation StartupAmt
Group3 Pancakes 5 50
? Use the set_info() member function to set the member variables Expenses,
Income and Sold for objects Group1, Group2 and Group3 as follows:
Update the points for each object (Group1, Group2 and Group3) by calling
member function update.points().
Use member function calc_profit() to calculate and update the profit for each
object (Group1, Group2 and Group3).
Use the overloaded stream insertion operator << to display the values of all
member variable of all 3 groups.
Use the overloaded relational operator> to determine which group is the winner,
and display the points and profit of the winning group.
This question was answered on: Sep 18, 2020
Buy this answer for only: $15
This attachment is locked
We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)
Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
About this QuestionSTATUS
Sep 18, 2020EXPERT
GET INSTANT HELP/h4>
We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.
You can also use these solutions:
- As a reference for in-depth understanding of the subject.
- As a source of ideas / reasoning for your own research (if properly referenced)
- For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
NEW ASSIGNMENT HELP?
Order New Solution. Quick Turnaround
Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.
WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.