ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 Jun 2017 My Price 8.00

Chapter 7 Create a counter

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:

Answers

(11)
Status NEW Posted 06 Jun 2017 07:06 AM My Price 8.00

-----------

Not Rated(0)