Answer to Question #47607 in Engineering for RKOSAMIA

Question #47607
Write a class ‘Counter’ which has a data member currentVal which hold the current value of the counter. Add a constructor which takes the intial value of the counter. Then add increment/decrement functions to this class which increment/decrement the value of the currentVal. Add a printValue function which prints the current value.
Then write a main function which will create a object of the Counter class with 5 as the initial value. Then call increment and decrement functions and print the values after each call.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS