Question
C++11 need guidance. Thanks We will simulate a very basic hotdog stand empire. Requirements: General Requirements You will be submitting eight (8) files for this
C++11 need guidance. Thanks
We will simulate a very basic hotdog stand empire. Requirements: General Requirements You will be submitting eight (8) files for this assignment Be sure to split your code among the files appropriately The name of your executable shall be hw03 Create two classes and name their types HotdogStand and Money All relevant classes, functions, and data shall be placed in a namespace called MyAwesomeBusiness Use initialization sections where possible for all constructors With the sole exceptions being the print() function(s), no other functions should be printing to the screen unless an error message must be displayed Money Class Requirements Negative amounts of Money shall be stored by making both the dollars and cents negative The Money class shall have four (4) constructors A default constructor that initializes your Money object to $0.00 A constructor that takes two integers, the first for the dollars and the second for the cents A constructor that takes one integer, for an clean dollar amount A constructor that takes one double, and can assign dollars and cents accordingly int getPennies() const Returns the equivalent amount of money as a number of pennies bool isNegative() const Returns true if your amount of money is negative void add(const Money &m) The sum shall be stored in the calling object void subtract(const Money &m) The difference shall be stored in the calling object bool isEqual(const Money &m) const void print() const This function prints the amount of Money you have; it must print a $, and always show two decimal places Negative amounts of Money shall be represented in the following manner: ($X.XX) The Money class shall have two private data members An integer that represents how many dollars you have. An integer that represents how many cents you have. HotdogStand Class Requirements The HotdogStand class shall have two (2) constructors A default constructor that initializes your HotdogStand object with no cash, a price of $3.50, and no hotdogs sold A constructor that takes a double, and initializes your HotdogStand object with no cash, the provided hotdog price, and no hotdogs sold const Money getCash() const This returns the total cash the HotdogStand has const Money getPrice() const int getDogsSold() const This returns the number of hotdogs sold by the stand const Money getStandRevenue() const This calculates the total money made by selling hotdogs void setPrice(double price) void sellHotdog() Increments all appropriate data members accordingly static int getNumStands() static int getTotalHotdogsSold() static const Money getTotalRevenue() The HotdogStand class shall have six (6) private data members A Money object that will represent how much money the stand has made A Money object that will represent the price of a hotdog An integer that will describe how many hotdogs a stand has sold A static integer that represents the total number of HotdogStand objects A static integer that represents the total number of hotdogs sold
A static Money object that represents total revenue for all HotdogStand objects Non-Member Requirements Define the following non-member function: void printRundown(const vector
makefile Requirements Your makefile must still include the requisite comment block Your makefile must compile each class separately Your makefile must include a clean rule Hints: The functions getCash() and getStandRevenue() will return the same amount of money in this assignment. However, it will be better to code the functions according to their descriptions It is possible to typedef a namespace. It looks something like this: namespace alias = namespace; To ensure a proper count of Hotdog Stands, you may want to look up the vector function emplace back() While not enforced in this assignment, this is a great time to practice not using directives, or at least placing them more smartly The C++11 library
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started