make improve this plzz???
Code:
#include<iostream.h>
void main()
{
float sum,difference,product,qoutient,a,b;
char mychoice,password,answer;
cout<<"enter your password"<<endl;
cin>>password;
if(password=='v')
{
cout<<"access granted....."<<endl;
cout<<"do you want to perform one of the four mathematical operations?"<<endl;
cout<<"mychoice"<<endl;
cout<<"a for addition"<<endl;
cout<<"s for subtraction"<<endl;
cout<<"m for multiplication"<<endl;
cout<<"d for division"<<endl;
cout<<"enter your choice"<<endl;
cin>>answer;
while(answer=='Y')//(answer!='N')
{
cout<<"mychoice"<<endl;
cout<<"a for addition"<<endl;
cout<<"s for subtraction"<<endl;
cout<<"m for multiplication"<<endl;
cout<<"d for division"<<endl;
cout<<"enter your choice"<<endl;
cin>>mychoice;
switch (mychoice)
{
case'a':
cout<<"enter first number"<<endl;
cin>>a;
cout<<"enter second number"<<endl;
cin>>b;
sum=a+b;
cout<<"the sum is:"<<sum<<endl;
cout<<"do you want to continue?"<<endl;
cin>>answer;
break;
case's':
cout<<"enter first number"<<endl;
cin>>a;
cout<<"enter second number"<<endl;
cin>>b;
difference=a-b;
cout<<"the difference is:"<<difference<<endl;
cout<<"do you want to continue?"<<endl;
cin>>answer;
break;
case'm':
cout<<"enter first number"<<endl;
cin>>a;
cout<<"enter second number"<<endl;
cin>>b;
product=a*b;
cout<<"the product is:"<<product<<endl;
cout<<"do you want to continue?"<<endl;
cin>>answer;
break;
case'd':
cout<<"enter first number"<<endl;
cin>>a;
cout<<"enter second number"<<endl;
cin>>b;
qoutient=a/b;
cout<<"the qoutient is:"<<qoutient<<endl;
cout<<"do you want to continue?"<<endl;
cin>>answer;
break;
default:
cout<<"invalid choice"<<endl;
break;
}
}
}
else
cout<<"invalid password!!"<<endl;
}