这个程序应该如何编写?很简单,但我不会……

来源:百度知道 编辑:UC知道 时间:2024/05/13 18:47:58
这个程序代码应该如何编写?(用C语言)
望高手指教!小女子急需支援!
某企业员工按小时计算工资,每月劳动时间(小时)×每小时工资=总工资,总工资中扣除10%公积金,剩余的为应发工资。编写一个程序计算并输出某位员工的应发工资。
具体要求:
①该员工的劳动时间和每小时工资数通过键盘输入,且在输入前要有提示信息。
②在输出结果时要有文字说明,输出结果的小数点后取2位小数。
③工作时间定义为基本整型变量,每小时工资及总工资定义为双精度类型。

#include\"stdio.h\"
main()
{ int hour;
float salary,fact;
printf(\"Please input the hours a day: \");
scanf(\"%d\",&hour);
printf(\"please input the salary per-hour: \");
scanf(\"%f\",&salary);
fact=(hour*salary)*0.9;
printf(\"The fact salary is: %.2f\\n\",fact);

}
基本上就这样,当然有些东西是可以变动的!!
没记错的话好象是课本上的习题!!可以的话加我qq:564250479

下面是C++的程序:
#include<iostream.h>
class employee
{
private:
int hour;
float payPerHour;
public:
void setWorkTime();
void setpayPerHour();
void countSalary();
};
void employee::setWorkTime()
{
cout<<"Please input the total hours of this month:";
cin>>hour;
}
void employee::setpayPerHour()
{
cout<<"please input the