An entrepreneur operating a day labor pool divides his workers into three skill levels. Unskilled workers receive RM10.20 per hour, semiskilled workers RM12.50 per hour, and skilled workers RM15.65 per hour.
Write a program that calculates a worker’s daily pay showing the RM sign and the amount formatted to two decimal places. Test your program for an input of odd, even, and fractional hours. Your program input should consist of the hours worked and the skill level indicator.
Do the program by using switch statement AND multiple if statements.
i need flow chart
1
Expert's answer
2012-09-27T10:53:46-0400
#include <conio.h> #include <iostream>
using namespace std;
int main() { int hoursworked; int skill; cout<<"Enter the hours worked: "; cin>>hoursworked; cout<<"Enter skill level indicator: (1- Unskilled) (2- Semiskilled) (3- Skilled) "; cout<<"Select skill: "; cin>>skill; double pay; switch(skill){ case 1: pay=20.20*hoursworked; cout<<"Pay is: "<<pay; break; case 2: pay=12.50*hoursworked; cout<<"Pay is: "<<pay; break; case 3: pay=15.65*hoursworked; cout<<"Pay is: "<<pay; break; } getch(); return 0; }
Comments
Leave a comment