📄 2i.cpp
字号:
// CALCPAY.CPP A program to calculate paychecks
#include <iostream.h>
void main()
{ float hours, pay, rate, overtime;
cout << "enter hours and rate: ";
cin >> hours >> rate;
overtime = hours - 40.0;
// employees working more than 40 hours receive overtime
if (overtime > 0.0)
pay = (40.0 * rate) + (overtime * 1.5 * rate);
else
pay = hours * rate;
cout << "pay is " << pay;
if (overtime > 0.0)
cout << " overtime worked";
else
cout << " no overtime worked";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -