:cheesy: Bit of a cheek I know but can anyone write some code for in C using if statements for the following:
1. "A man is paid the hourly rate of £10 per hour for the first 40 hours worked. After that, overtime is paid at 1.5 times the hourly rate for the next 30 hours worked and twice the hourly rate for further hours worked.
The 'if' statement needs to show number of hours worked, calculate and display basic pay, overtime pay and final gross pay."
And... if you're feeling really generous with your knowledge tonight... :eek:
2. "A car costs a certain amount. If it is silver there is an extra charge of £300. If it is an XL model there is an extra charge of £500.
The code needs to enter the basic price of the car. Ask if it is silver and add the extra charge if appropriate. Then ask if it is an XL model and add this extra charge if appropriate. Finally display the total price."
3. "A man has estabished the following set of rules for deciding what clothing to wear to enable him to walk to work comfortably in all weathers in the Spring:
- if the barometer indicates storm he wears his overcoat and hat
- if the barometer indicates rain he wears his raincoat and takes an umbrella
- if the barometer indicates change he bahaves as for fair if it rained yesterday and as for rain if it did not
- if fair is indicated he wears light over-jacket and takes an umbrella
- if very dry is indicated he wears light over-jacket
The code needs to input a coded barometer reading and whether it rained yesterday (where necessary), and the type of clothing he should wear."