Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use C++ for this problem. Please refer to teh samples as to how the output should look. Imagine you operate several hot dog stands

Please use C++ for this problem. Please refer to teh samples as to how the output should look.

Imagine you operate several hot dog stands throughout town. Define a class called HotDogStand that has member variables for the hot dog stand's ID number and how many hot dogs the stand sold that day. Create a constructor that allows a user of the class to initialize both values. Also create a function named JustSold, which increments the number of hot dogs the stands has sold by one. This function will be invoked each time the stand sells a hot dog so that you can track the total number of hot dogs sold by the given stand. Also add a function that returns the number of hot dogs sold from this stand. Finally, add a static variable that tracks the total number of hot dogs sold by all hot dog stands and a static function that returns the value in this variable. In main(), test your class by creating 4 instances of the HotDogStand class for stands that sell PLAIN, KETCHUP, MUSTARD, and RELISH hot dogs. Prompt the user to enter how many hot dogs each stand sold. Then, print out the total number of hot dogs sold by all stands and how many hot dogs each individual stand sold. Sample 1: EnterthenumberofhotdogssoldbythePLAINHOTDOGCART:103 EnterthenumberofhotdogssoldbytheKETCHUPHOTDOGCART:89 EnterthenumberofhotdogssoldbytheMUSTARDHOTDOGCART:52 EnterthenumberofhotdogssoldbytheRELISHHOTDOGCART:12 TOTALHOTDOGSSOLD:256 PLAIN:103 KETCHUP:89 MUSTARD:52 RELISH:12

Sample 2: EnterthenumberofhotdogssoldbythePLAINHOTDOGCART:-55 Enterapositivevalue:234 EnterthenumberofhotdogssoldbytheKETCHUPHOTDOGCART:77 EnterthenumberofhotdogssoldbytheMUSTARDHOTDOGCART:111 EnterthenumberofhotdogssoldbytheRELISHHOTDOGCART:2 TOTALHOTDOGSSOLD:424 PLAIN:234 KETCHUP:77 MUSTARD:111 RELISH:2

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

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Differentiate between FIFO and LIFO.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago