Create a class Calculator having two integer data members and one string member i.e. operator. Class contains only one customized constructor which take two arguments, set the default values 1 if no argument is passed through the constructor. Class Calculator also contains a member function Calculate() that takes an operator (string) as an argument and compute it. Only four operators are allowed i.e. +, -, *, /

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 1PE: In Chapter 10, the class clockType was designed to implement the time of day in a program. Certain...
icon
Related questions
Question
100%

 

Create a class Calculator having two integer data members and one string member i.e. operator. Class contains only one customized constructor which take two arguments, set the default values 1 if no argument is passed through the constructor. Class Calculator also contains a member function Calculate() that takes an operator (string) as an argument and compute it. Only four operators are allowed i.e. +, -, *, /

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning