Answer to Question #254311 in C++ for Fisiwe Shezi

Question #254311

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.


1
Expert's answer
2021-10-25T17:00:22-0400
#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";}
	}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS