Parents of the pupils of the Park Primary School must pay an amount for outfits for the annual
play. All pupils take part in the play, except the Grade 0 pupils. The amount that the parents have
to pay is calculated as follows:
The cost of the outfits for Grade 1 and 2 pupils is R45.
The cost of the outfits for Grades 3 to 5 is R65.
Grade 6 and 7 pupils may play one or two roles. If they play a lead role, they may only play
one role. The cost of the outfits is R70 if they play one role. If this role is a lead role, the
cost is R100. If they play two roles, the cost is R130.
#include<iostream>
using namespace std;
int main()
{
int g;
cout<<"Enter the grade you are: ";
cin>>g;
if(g==1 || g==2){
cout<<"The cost of the outfit is R45";
}
else if(g==3 || g==4 || g==5){
cout<<"The cost of the outfit is R65";
}
else if(g==6 || g==7){
int option;
cout<<"Enter your option\n1. One role\n2.Two roles\n ";
cin>>option;
if(option==1){
int opt;
cout<<"Choose an option\n1. Lead role\n2. One role\n";
cin>>opt;
if(opt==1){
cout<<"The cost of the outfit is R100";
}
else if(opt==2){
cout<<"The cost of the outfit is R70";
}
else{
cout<<"Invalid option";
}}
else if(option==2){
cout<<"The cost of the outfit is R130";
}}
else if(g==0){
cout<<"Cannot take part in the play";
}
else{
cout<<"Invalid option";}
}
Comments
Leave a comment