Question

SECTION B 80 MARKS QUESTION 1 12 marks Parents of the pupils of the Park Primary School must pay an amount for outfits for th

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • If you have any doubts , feel free to ask in comments.
  • The required c++ statements are provided below along with screenshots.
  • In case , if you need, the full program have also been provided in last section of this answer along with screenshots of code and output.
  • Please give this answer a like , this will be very helpful for me.

=====================================================================

C++ statments of switchcase and ouput, to calculate and display amount (not full program)

(Here , i have assumed that values have been assigned to the values already)

// switch case statement for calculating fee switch (grade) { 12 13 14 15 16 17 18 19 20 21 case 1 ... 2: //if grade is 1 or38 39 40 default: //displaying that grade value isnt correct cout<<INPUT GRADE VALUE!<<endl; 41 42 43 } 44 //display state

--------------------------------------------------------------------------------

//switch case statement for calculating fee
switch(grade){
  
case 1 ... 2 :
//if grade is 1 or 2 , then fee will be 45 and then switch will break
fee = 45;
break;

case 3 ... 5 :
//if grade is 3,4 or 5 , then fee will be 65 and then switch will break
fee = 65;
break;

case 6 ... 7 :
//checking using if statements if leadrole or 2 roles is true or not
if(leadrole == true)
{
fee = 100;
}else if(roles2 == true)
{
fee = 130;
}else
{
fee = 70;
}
break;

default:
//displaying that grade value isn't correct
cout<<"INPUT GRADE VALUE!"<<endl;
}

//display statement to show amount to be paid
cout<<"Amount to be paid: R"<<fee<<endl;

---------------------------------------------------------------------------

===============================================

FULL PROGRAM (IF YOU NEED)

--------------------------------------------------------------------------

#include <iostream>

using namespace std;

int main()
{
int grade = 7;
int fee = 0;
bool leadrole = false;
bool roles2 = true;

//switch case statement for calculating fee
switch(grade){
  
case 1 ... 2 :
//if grade is 1 or 2 , then fee will be 45 and then switch will break
fee = 45;
break;

case 3 ... 5 :
//if grade is 3,4 or 5 , then fee will be 65 and then switch will break
fee = 65;
break;

case 6 ... 7 :
//checking using if statements if leadrole or 2 roles is true or not
if(leadrole == true)
{
fee = 100;
}else if(roles2 == true)
{
fee = 130;
}else
{
fee = 70;
}
break;

default:
//displaying that grade value isn't correct
cout<<"INPUT GRADE VALUE!"<<endl;
}

//display statement to show amount to be paid
cout<<"Amount to be paid: R"<<fee<<endl;

return 0;
}
---------------------------------------------------------------------------------------

main.cpp X #include <iostream> using namespace std; 1 2 3 4 5 6 7 int main() { int grade = 7; int fee = 0; bool leadrole = famain.cpp X 21 //if grade is 3,4 or 5, then fee will be 65 and then switch will break fee = 65; break; case 6 ... 7 : //checkiAmount to be paid: R130

=============================================================

Add a comment
Know the answer?
Add Answer to:
SECTION B 80 MARKS QUESTION 1 12 marks Parents of the pupils of the Park Primary...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • SECTION B 80 MARKS QUESTION 1 12 marks Parents of the pupils of the Park Primary...

    SECTION B 80 MARKS QUESTION 1 12 marks 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...

  • QUESTION 1 12 marks Parents of the pupils of the Park Primary School must pay an...

    QUESTION 1 12 marks 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 O 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...

  • SECTION B 80 MARKS QUESTION 1 12 marks Parents of the pupils of the Park Primary...

    SECTION B 80 MARKS QUESTION 1 12 marks 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...

  • Parents of the pupils of the Park Primary School must pay an amount for outfits for...

    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...

  • Parents of the pupils of the Park Primary School must pay an amount for outfits for...

    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 O 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...

  • Parents of the pupils of the Park Primary School must pay an amount for outfits for...

    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...

  • Parents of the pupils of the Park Primary School must pay an amount for outfits for...

    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...

  • QUESTION 2 [12] Parents of the pupils of the Park Primary School must pay an amount...

    QUESTION 2 [12] 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...

  • Parents of the pupils of the Park Primary School must pay an amount for outfits for...

    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...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT