Question

QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code Snippet :

#include <iostream>

using namespace std;

int main()
{
const float sunday = 200;
float other = 100;
char whichDay;
float totalAmount = 0;
int nrSundays = 0;
  
cout<<"Enter first day: '2' for Sunday and '1' for other days"<<endl;
cin>>whichDay;
  
while(whichDay != 'x')
{
if(whichDay == '1')
totalAmount += other;
else if(whichDay == '2')
{
totalAmount += sunday;
nrSundays++;
}
cout<<"\nEnter first day: '2' for Sunday and '1' for other days"<<endl;
cin>>whichDay;
}

cout<<"\n\nTotal Salary: "<<totalAmount<<endl;
cout<<"\nNumber of sundays worked: "<<nrSundays<<endl;
  
return 0;
}

Code Screenshot :

ca triangle - Paint File Home View * Cut Outline Copy 4 Crop Resize Rotate - A Q Brushes DOLA OD 1 OOO . Fill Paste Select Si

Code Output :

ca triangle - Paint File Home View Outline * Cut Copy A 4 Crop Resize Rotate - DOLA MOOOD. DO Fill Paste Select Brushes Size

Description :

This code will calculate total salaries according to the input and will also count number of sudays.

Please be carefull while copying the code. Refer the screenshot for the proper indentation.

Add a comment
Know the answer?
Add Answer to:
QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they...
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
  • QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they...

    QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R200 if they work on a Sunday. They only work when the company contacts them, so they do not work the whole month. Complete the program below that asks the user to enter the days that the worker has worked. The character 'l' is entered if the day is Monday to Saturday and 2' if it is...

  • QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they...

    QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R200 if they work on a Sunday. They only work when the company contacts them, so they do not work the whole month. Complete the program below that asks the user to enter the days that the worker has worked. The character 'l' is entered if the day is Monday to Saturday and '2' if it is...

  • QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they...

    QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R200 if they work on a Sunday. They only work when the company contacts them, so they do not work the whole month. Complete the program below that asks the user to enter the days that the worker has worked. The character '1' is entered if the day is Monday to Saturday and '2' if it is...

  • A construction company pays its temporary workers R100 per day if they work on a Monday...

    A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R200 if they work on a Sunday. They only work when the company contacts them, so they do not work the whole month. Complete the program below that asks the user to enter the days that the worker has worked. The character 'l' is entered if the day is Monday to Saturday and '2' if it is a Sunday. A total...

  • Wadow Help COS1511 2012 2. COS1511 Nov 2012 semester 1 past pap... 2012_2017-sem2... COS1511 201 3...

    Wadow Help COS1511 2012 2. COS1511 Nov 2012 semester 1 past pap... 2012_2017-sem2... COS1511 201 3 2 Solutions to exeras.. COS1511.PDF 9 / 12 100% QUESTION 2 10 marks A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R200 if they work on a Sunday. They only work when the company contacts them, so they do not work the whole month. Complete the program below that asks the user to...

  • A construction company pays its temporary workers R100 per day if they work on a Monday...

    A construction company pays its temporary workers R100 per day if they work on a Monday to Saturday and R200 if they work on a Sunday. They only work when the company contacts them, so they do not work the whole month. Complete the program below that asks the user to enter the days that the worker has worked. The character 'l' is entered if the day is Monday to Saturday and 2’ if it is a Sunday. A total...

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

  • Actions that damage a company and its employees should be stamped out, everyone would agree. But ...

    Actions that damage a company and its employees should be stamped out, everyone would agree. But should the people responsible be stamped out, too? HBR CASE STUDY The Reign of Zero Tolerance by Ben Gerson "Mr. Pemberton?" manager. The guards had radioed her that the "Yes, that's me," Simon replied distractedly, his back turned. target wasn't putting up much resistance. "Your personal belongings will be messen The two burly gentlemen who had suddenly gered to your home later today," Sallie...

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