Hello All,Iam Obi fronm Nigeria and has been studying c++ for some time now .I recently took on a challenge to design a kind of airtime service for the mobile communication industry but can only say that I have not really delivered on that.Below is the code and I would welcome useful suggestions on how to improve on this code.I don't have any contract with anyone and therefore would not mind any delay.The service is supposed to let the subscriber access aitime worth 200 units of currency after which he is billed whenever he recharges.Is this the best way to go about it?
#include<iostream>
#include<string>
using namespace std;
int main()
{
float ac_bal=0.0;
int recharge_no;
bool status=false;
cout<<"You can use the emergency service now"<<endl;
cout<<"Have a nice time"<<endl;
cout<<"Enter your 4-digit number now for the EAR or your 5-digit number"<<endl;
cout<<"for the regular service,Have a nice time"<<endl;
cin>>recharge_no;
if(status==true){
if(recharge_no==3553){
ac_bal +=200.0;
val_period +=1;
status=false;
cout<<"Your account balance now is "<<ac_bal<<endl;
cout<<"Your EAR status is "<<status<<endl;exit(0);}}
if(status==true){
switch(recharge_no){
case(1234):ac_bal+=100.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1235):ac_bal+=200.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1225):ac_bal+=300.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1215):ac_bal+=500.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1205):ac_bal+=1000.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1995):ac_bal+=3000.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1985):ac_bal+=6000.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
default:cout<<"Wrong number on network!,Try Again or check your Ear status"<<endl;exit(0);
}}
if(status==false){
switch(recharge_no){
case(1234):ac_bal+=50.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1235):ac_bal+=100.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1225):ac_bal+=200.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1215):ac_bal+=300.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1205):ac_bal+=800.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1995):ac_bal+=2800.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
case(1985):ac_bal+=5800.0;cout<<"Your account balance now is "<<ac_bal<<endl;break;
default:cout<<"Wrong number on network!,Try Again"<<endl;exit(0);
cout<<"Your account balance is now "<<ac_bal<<endl;
}
status=true;}
cout<<"Your EAR status is "<<status<<endl;
return 0;
}