The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
hello,Â
Chapter 7
Â
Create a counter. The default constructor should set the count to zero. The overloaded constructor should initialize to any integer. Provide a display(), inc() and dec() method. Inc does ++ dec does – – on the private count variable. Use private: and public: where they should be used.
Â
Chapter 8
Â
Implement a class money. You must have friend functions for I/O that overload << and >>. You must have multiple constructors, You must implement a percentage method,+,-, <,>. There is a starting money class in your text.
Â
thanks
Â
Â
Â
Chapter 7Create a counter.The default constructor should set the count to zero.The overloaded constructorshould initialize to any integer. Provide a display(), inc() and dec() method.Inc does ++ dec does – –onthe private count variable.Use private: and public: where they should be used.Write a demo program that initializes one counter to 0 and the other to 200.Increment the first counter by85 and decrement the second counter by 242.Use a for loop to increment and decrement.Use a static variable to keep track of the total number of incs and decs. Keep in mind that after youdeclare a static variable in a class, you must declare it outside the class and use the scope resolutionoperator.Example:Current state of C1 (created with the default constructor)Current count: 0total increments and decrements 0Current state of C2 (created as C2(200))Current count: 200total increments and decrements 0Current state of C1 after 85 inc()Current count: 85total increments and decrements 85Current state of C2 after 242 dec()Current count: -42total increments and decrements 327Press any key to continue . . .
Chapter 8Implement a class money.You must have friend functions for I/O that overload << and >>.You musthave multiple constructors,You must implement a percentage method,+,-, <,>.There is a starting moneyclass in your text.Example:Enter an amount of money: $14.33Your amount is $14.33My amount is $10.09One of us is richer.You have more money than me.10% of your money is: $$1.43$14.33 + $10.09 equals $24.42$14.33 - $10.09 equals $4.24Press any key to continue . . .
Attachments: