there are 3 member functions.1st one to set value for person discount,distance.second one to display personcount,distance and fair .3rd function to caliculate the fair with assumption that fair for 1 person is 300rupees if distance>=1200km and 200 rs for<500kmand for in between distance it is 350 rupees write c++pgm
int discount(int price, int discount) {
int result = price-(price*discount/100);
return result;
}
int fair(int cntPeople) {
return cntPeople*300;
}
Comments
Leave a comment