forked from samithaHewawasam/cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrattings.cpp
52 lines (38 loc) · 925 Bytes
/
rattings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
*Project:20;
*Author:Samitha Hewawasam;
*Date:2015-06-05;
*Tool:atom text editor;
*Compiler:g++;
*OS:ubuntu 14.04;
*Extra Tools: astyle prity print
*/
#include <iostream>
void main() {
//let's get a char varible, 2 varibles for float, an integer
int rate;
float salary, bonus;
char name;
//Ask from employee to enter
cout<<"Enter employee name:\n";
cin>>name;
cout<<"Enter employee salary:\n";
cin>>salary;
cout<<"Enter performance rating:\n";
cin>>rate;
if(rate == 1)
bonus=10;
else if(rate == 2)
bonus=5;
else if(rate == 3)
bonus=2.5;
else if(rate == 4)
bonus=0;
else
cout<<"Invalid data";
cout<<"Employee name:"<< name;
cout<<"Employee salary:"<<salary;
cout<<"Employee rating:"<<rate;
cout<<"Employee bonus:"<<salary + salary*bonus/100;
cout<<"Salary and bonus: "<<rate;
}