#include <iostream>
using namespace std;
int main()
{
const float SUNDAY=200;
float OTHER=100;
char whichDay;
float totalAmount;
int nrSundays;
cout<<"Enter first day:'2' for Sunday, '1' for other
days"<<endl;
cin>>whichDay;
totalAmount=0;
nrSundays=0;
while(whichDay!='x')
{
if(whichDay=='1')
{
totalAmount=totalAmount+OTHER;
}
else if(whichDay=='2')
{
totalAmount=totalAmount+SUNDAY;
nrSundays++;
}
cin>>whichDay;
}
cout<<"Total salary:"<<totalAmount<<endl;
cout<<"number of Sundays
worked:"<<nrSundays<<endl;
return 0;
}
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...
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 a...
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...
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 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 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 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...
The XYZ Company needs you to write a program that will allow them to enter the weekly sales for a salesperson and then the program will calculate things such as most sales (and what day on which they happened), least sales (and day on which they happened), total sales, and daily average. The program will need to do the following: • Validate the user input to ensure that it is not less than 0.0 (0.0 will be acceptable if there...
Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...