Banner Ad

    A    L    W    A    Y    S           D    E    S    I    R    E           T    O           L    E    A    R    N           S    O    M    E    T    H    I    N    G           U    S    E    F    U    L   

Monday, May 9, 2011

2010 Final IPE_UNIXC_-1151b question 2

#include <iostream>
using namespace std;
int main()
{

      char ch,let;
     



      cout<<"Do you want to continue  y/n : ";
      cin>>ch;
 while(ch!='n'||ch!='N')
{
      if(ch=='Y'||ch=='y')
      {
     
            cout<<"Enter your package letter  :  ";
            cin>>let;
      if(let=='A')
      {
      cout<<"Your total expenditure is  =  "<<(15000+25000+32000)*97/100.0<<endl;
      }
      else if(let=='B')
        {
      cout<<"Your total expenditure is  =  "<<(17000+28000+36000)*95/100.0<<endl;
        }
      else if(let=='C')
        {
      cout<<"Your total expenditure is  =  "<<(20000+35000+40000)*93/100.0<<endl;
        }
      else if(let=='D')
        {
      cout<<"Your total expenditure is  =  "<<(25000+38000+45000)*91/100.0<<endl;
        }
      else
      {
      cout<<"ERROR invalid package number entered  "<<endl;
      }
      cout<<"Do you want to continue  y/n :  ";
      cin>>ch;
      }
     
      else if(ch=='N'||ch=='n')
      {
      return -1;
      }
      else if(ch!='Y'||ch!='y')
        {
      cout<<"please enter valid codes to continue in this programme such as y to continue or n to terminate"<<endl;
      cout<<"Thank you"<<endl;
      return -1;
        }

}
      return 0;
}
 

0 comments:

Related Posts Plugin for WordPress, Blogger...

your comments