Final answer:
To solve this problem, you need to create a class called Calculator with two public methods: Process and GetResult. The Process method takes a string command as input and performs the arithmetic operation specified in the command. The GetResult method returns the result of the last operation.
Step-by-step explanation:
To solve this problem, you need to create a class called Calculator with two public methods: Process and GetResult. The Process method takes a string command as input and performs the arithmetic operation specified in the command. The GetResult method returns the result of the last operation. The class should have a private data field to store the result of the last command, which can be accessed using the GetResult method. In the main program, you can create an instance of the Calculator class and use it to repeatedly process and display the result of commands entered by the user. The program can stop when the user enters a special value or an empty command line.