Question: #include declare.h int a; int b; int r; integer::integer() { } integer::integer(int y) {// constaructor with para Digit = y; } integer::~integer() { } //part

#include "declare.h" int a; int b; int r; integer::integer() { } integer::integer(int y) {// constaructor with para Digit = y; } integer::~integer() { } //part b to put set and gets int integer::getIntNum() { return Digit;//getting the Digit to return } void integer::setIntNum(int y) {//set method to intilize the memeber variable Digit = y; } //part c wants us to have add,mult,sub,div in the class void integer::add() {//simple function to add r = a + b; } void integer::sub() {//simple function to sub r = a - b; } void integer::mult() {//simple fucntion to mult r = a * b; } void integer::divide() {//simple fucntion for div r= a / b; }; ///////// #include "declare.h" int a; int b; int r; integer::integer() { } integer::integer(int y) {// constaructor with para Digit = y; } integer::~integer() { } //part b to put set and gets int integer::getIntNum() { return Digit;//getting the Digit to return } void integer::setIntNum(int y) {//set method to intilize the memeber variable Digit = y; } //part c wants us to have add,mult,sub,div in the class void integer::add() {//simple function to add r = a + b; } void integer::sub() {//simple function to sub r = a - b; } void integer::mult() {//simple fucntion to mult r = a * b; } void integer::divide() {//simple fucntion for div r= a / b; }; //////// #include #include "declare.h" using namespace std; integer fObj; integer sObj; integer rObj; char operation; int main() { const int A = 0; const int B = 1; const int C = 2; const int D = 3; const int E = 4; int y = 0; int s = 0; while (operation != E) { cout << "choose A=add, B=sub, C=mult, D=div, and E if you want to exit." << endl; cin >> operation; switch (operation) { case A: cout << "Choose any number to add..." << endl; fObj.setIntNum(y); sObj.setIntNum(s); rObj.add(); cout << "Answer: " << rObj.getIntNum() << endl; case B: cout << "Choose any number to sub..." << endl; fObj.setIntNum(y);//SETS THE VALUE TO WHAT THE USER WANTS sObj.setIntNum(s); rObj.sub(); cout << "Answer: " << rObj.getIntNum() << endl; case C: cout << "Choose any number to mult..." << endl; fObj.setIntNum(y); sObj.setIntNum(s); rObj.divide(); cout << "Answer: " << rObj.getIntNum() << endl; case D: cout << "Choose any number to div..." << endl; fObj.setIntNum(y); sObj.setIntNum(s); rObj.mult(); cout << "Answer: " << rObj.getIntNum(); case 5: cout << "Exiting" << endl; break; } } } I CANT FIGURE OUT WHY I KEEP GETTING A LOOP OF (choose A=add, B=sub, C=mult, D=div, and E if you want to exit.) AND I CANT DO NOTHING. I GAVE U MY WHOLE SOURCE CODE. PLEASE CHECK AND GIVE ME A FIX THNAK YOU.

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 Databases Questions!