You are on page 1of 1

include < iostream >

using namespace std;


class details
{
protected :
char name[20],mob[20],add[20],id[10];
int num,bills[20];
void get_details()
{
cin>>name>>mob>>add>>id>>num;
for(int i=0;i < num;i++)
cin>>bills[i];
}
};
class customer : public details
{
public :
void get()
{
get_details();
}
float calc_Total()
{
float total=0;
for(int i=0;i < num;i++)
total+=bills[i];
return(total);
}
};
class preferred_Customer : public details
{
public :
void get()
{
get_details();
}
float calc_Total()
{
float total=0,spent=0;
for(int i=0;i < num;i++)
{
spent+=bills[i];
if(spent > =20000)
total+=bills[i]*0.96;
else if(spent > =15000)
total+=bills[i]*0.97;
else if(spent > =10000)
total+=bills[i]*0.98;
else if(spent > =5000)
total+=bills[i]*0.99;
else
total+=bills[i];
}
return(total);
}
};

You might also like