Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++. Create two classes and name their types HotdogStand and Money All relevant classes, functions, and data shall be placed in a namespace called MyAwesomeBusiness

C++. Create two classes and name their types HotdogStand and Money All relevant classes, functions, and data shall be placed in a namespace called MyAwesomeBusiness 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 not 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 variable: const std::vector &franchises Define the following non-member function: void printRundown(const vector &franchises, int num) * This function will print the summary of the HotdogStand

How many hotdog stands do you own?

3 How many of those sell classy hotdogs? 1 How much does a classy hotdog cost? $8

stand 1

sales 47

price $3.50

revenue $164.50 main() Requirements The end-user shall be prompted for how many hotdog stands they own The end-user will then be prompted for how many of those hotdog stands sell fancy hotdogs If the above input is greater than zero (0), the end-user shall be prompted for the price of the fancy hotdogs The end-user may type the price with or without the $ The simulation is then run and the output is printed to the screen Simulation Requirements The simulation only runs through a single day The last n stands are always fancy, where n is the number of stands designated as fancy by the end-user Regular hotdog stands can sell a random number in the range 20 - 60 (inclusive) hotdogs a day Fancy hotdog stands can sell a random number in the range 1 - 30 (inclusive) hotdogs a day

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How do time cards differ from time tickets? LO.1

Answered: 1 week ago