Hypermarket Programming to calculate employee's Pay and Overtime

Can someone show me how to begin.Thx

.A hypermarket pays its employees on work-hours basis and by category as shown in the table below. The hypermarket pays “straight-time” for the first 40 hours worked by each employee and pays “time-and-a-half” for all hours worked in excess of 40 hours for only category A1, B2 and M1. No extra pay for other categories. The total work hours for each employee cannot exceed 60 hours per week. The program should request employee’s name, their identification number, the number of hours employees’ work last week and his category. Your program should display all related information about the employee including employee’s gross pay, overtime pay and net salary.
A1 $ 10
B2 $ 12
M1 $ 14
M2 $ 15
M8 $20
Last edited on
do you mean have the radius as input?
This should also be in the beginners section

Look here for printf: http://www.cplusplus.com/reference/clibrary/cstdio/printf/
(i just use cin and cout for things like this)
use cin to store the radius into a double.
make PI a const double.
then printf or cout the stuf you want by typing in the calculations.

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <stdio.h>

//I would put PI here, though you can do it in main

int main()
{
//make the double radius
cin >> r;  //where r is the double for the radius

//print the calculations here

return 0;

Last edited on
Thanks Buddy
Yes I am using radius input. Can you provide me more details so that I have the bigger picture?.Thx
Last edited on
.
Last edited on
I had already done this however when I key in the radius number , the result =0.. Now were is the one that I get stuck..Can u help

#include<stdio.h>
#include<math.h>
#include<conio.h>


main()

{
int pi=3.14159;
int r;
float cir,area,dia ; // Saya declare variable
//float 2*pi*r,pi*r*r,2*r



printf("Sila masukkan radius : ");
scanf("%f",&r);

printf(" cir ialah %.2f ", cir);


2*pi*r =cir ;
pi*r*r =area;
2*r = dia;


printf("cir %f + %f = %.2f : ", cir);
printf("area %f + %f = %.2f : ", area);
printf("diacir %f + %f = %.2f : ", dia);


return 0;

}
Last edited on
secondly can u help me on how to write a Pseudo-code for this program.thx
First line is int main()

Take a close look at this:
1
2
3
4
5
6
7
8
9
10
int main()
{
   int x, y;
   x = 5;  //5 is assigned to x 
   9 = y; 

   printf("x = %d and y = %d", x, y); //value of x is printed in the first %d, the value of y is printed in the second %d

   return 0;
}


output:
x = 5 and y = 0*
(*maybe)
Hopefully this example will help you fix the mistakes in ur program :) Cheers
Last edited on
Hey arahalim, you changed your original post and put in a brand new question. Can you please put ur original post back and move this new problem to a new topic ? Thanks
Topic archived. No new replies allowed.