/*
*copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称:test6.cpp
*作者:孙春红
*完成日期:2014年10月16号
*版本号:v1.0
*
*问题描述:输入rate和hour,计算出员工的周工资
*输入描述:两个整数,分别代表hour和rate
*程序输出:一个整数,代表周工资
*/
#include <iostream>
using namespace std;
int main()
{
double rate,hour,s;
cout <<"输入上班的时间和时薪:";
cin >>hour>>rate ;
if(hour<=40)
s=hour*rate;
else
s=40*rate+(hour-40)*rate*1.5;
cout << "你的周工资是:" <<s<< endl;
return 0;
}
运行结果:
知识点总结:
通过本次的学习,真的学到了很多,学会用简单的if-else语句来写代码
学习心得:
在运行程序的时候,需要小心小心再小心。。。。。