Question: Use an IDE CircleType C + + You will need three files inside of the project: counterType.h counterTypeImp.cpp main.cpp Requirements Define a class counterType to

Use an IDE
CircleType
C++ You will need three files inside of the project:
counterType.h
counterTypeImp.cpp
main.cpp
Requirements
Define a class counterType to implement a counter. Your class must have a private data member counter of type int and the following member functions:
setCounter - Sets counter to the value specified by the user.
getCounter - Retrieves the value of counter.
increment - Increments counter by 1.
decrement - Decrement counter by 1.
print - Displays the current value of counter preceded by the text "counter =."
Remember, your class definition containing your member variables and member function prototypes will be stored in counterType.h. Your member function definitions will be stored in counterTypeImp.cpp.
Write a program in main.cpp that declares an object of type Counter, prompts the user to enter the initial value of the counter, and displays a menu to the user asking if they want to 1) Increment the counter, 2) Decrement the counter, 3) Print the current value, or 4) Exit the program. The menu should repeatedly display until the user chooses to exit the program. The first three menu items should utilize the appropriate member function of the counter object to perform the appropriate operation. The fourth menu option should actually exit the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!