#include #include class octal {private:int ov; public:octal() {ov=0;} void getdata(); void octcon(int); octal operator=(int a); int operator+(int a); void showdata(int iv,int x) {cout<<"\n the decimal number:"; cout<>ov; temp=ov; while(i==0) {if((temp%10)>7) {c++;} temp=temp/10; if(temp==0) {i=1;} } if(c!=0) {cout<<"\n invalid value enter again \n"; } if(c==0) {x=1;} } } int octal :: operator+(int v) {int c=0,l,k=1,temp; temp=ov; while(temp!=0) {l=temp%10; l=l*k; c=c+l; temp=temp/10; k=k*8; } temp=c+v; return temp; } octal octal:: operator=(int iv) {int r=0,i=0,j,l,k,temp; temp=iv; while(temp!=0) {k=1; for(j=0;j>c; switch(c) {case 1:cout<<"\n enter the integer value to be converted:"; cin>>v; n1.octcon(v); n1.showdata(v); break; case 2:n1.getdata(); cout<<"\n enter the integer value to be added:"; cin>>v; n2=n1+v; n2.showdata(v,0); break; case 3:k=1; cout<<"\n thanks for using the program"; break; default:cout<<"\n you have entered wrong choice try again"; getch(); } } getch(); }