- 分享
- 0
- 人气
- 0
- 主题
- 5
- 帖子
- 4516
- UID
- 140257
- 积分
- 10923
- 阅读权限
- 25
- 注册时间
- 2008-5-2
- 最后登录
- 2021-2-3
- 在线时间
- 3371 小时
|
回复 #34 Super-Tomato 的帖子
- #include<iostream>
- using namespace std;
- int main()
- {
- int a,b,c,d,i,j,k,l,y[30],z
- double pay;
- cout<<"Please enter the number of managers\n";
- cin>>a;
- cout<<"Please enter the number of hourly workers\n";
- cin>>b;
- cout<<"Please enter the number of commission workers\n";
- cin>>c;
- cout<<"Please enter the number of piece workers\n";
- cin>>d;
- cout<<"Enter the weeklypay for all managers\n";
- for(z=0;z<a;z++)
- {
- cin>>y[z];
- }
- cout<<"The salary for all the managers are\n";
- for(z=0;z<a;z++)
- cout<<"$"<<y[z]<<"\n";
复制代码 我這個array只能解決第1類型worker(manager)而已
至于我第2個worker有formula的
i=payrate
j=hoursworked
k=OT payrate(only applicable if hoursworked exceed 40 hours)
l=OT hours worked(only applicable if hoursworked exceed 40 hours, eg work for 50 hours it must automatically count 10 hours as OT hours)
pay = i*j+(1.5*k*l)
我就真的不知道要怎樣做了
[ 本帖最后由 虚空使者 于 2008-11-10 07:20 PM 编辑 ] |
|