Question #29427

Write c++ program for calculation of discount of a group. In a group there is 2 gender, male and female. If the group has at least 5 male,10% discount will be given. If the group has more than 5 person (male and female), 25% discount will be given. If the group has at least 15 persons (male and female), 30% discount will be given.

Expert's answer

//Write c++ program for calculation of discount of a group. In a group there

//is 2 gender, male and female. If the group has at least 5 male,10% discount

//will be given. If the group has more than 5 person (male and female), 25%

//discount will be given. If the group has at least 15 persons (male and

//female), 30% discount will be given.

# include <iostream>

using namespace std;

int main(){

cout<<"Enter amount of male persons:";

int m,f;

cin>>m;

cout<<"Enter amount of female persons:";

cin>>f;

int disk=0;

if (m==5) disk=10;

if (m+f>5) disk=25;

if (m+f>=15) disk=30;

cout<<"Your discount is "<<disk<<"%\n";

system("PAUSE");

return 0;

}

//is 2 gender, male and female. If the group has at least 5 male,10% discount

//will be given. If the group has more than 5 person (male and female), 25%

//discount will be given. If the group has at least 15 persons (male and

//female), 30% discount will be given.

# include <iostream>

using namespace std;

int main(){

cout<<"Enter amount of male persons:";

int m,f;

cin>>m;

cout<<"Enter amount of female persons:";

cin>>f;

int disk=0;

if (m==5) disk=10;

if (m+f>5) disk=25;

if (m+f>=15) disk=30;

cout<<"Your discount is "<<disk<<"%\n";

system("PAUSE");

return 0;

}

Learn more about our help with Assignments: C++

## Comments

## Leave a comment