0
Please i want to find the grosspay of some workers and do you mind helping
5 ответов
+ 1
May you be called blessed
+ 1
Thanks for your kind words too ..
I will try and learn it well..
But i will love it if you could tutor me and give me challenges ..
0
Immanuel Immanuel run this 
#include <iostream>
using namespace std;
int main() {
   int workHours[7] = {40,65,88,39,50,24,78};
   int fixedpay=500;  //pay for 30 hours work 
   int excessHours;
   double grossPay;
   for(int x=0;x<7;x++){
      excessHours=workHours[x]-30;
      grossPay=fixedpay+excessHours*10.5;
      cout<<grossPay<<endl;
   }
    return 0;
}
0
https://code.sololearn.com/c5p63P2m5wQm/?ref=app
It worked perfectly 
Thanks for your good work.
But i want to loop the names of the workers with their corresponding pay ..
Please check whats wrong with that .
0
#include <iostream>
using namespace std;
int main() {
int workHours[7]={40,65,88,39,50,24,78};
string workers [7]={"Billy","Lawrence","Nti","Anane","Jane","Gyan","Quaye"};
int fixedPay = 500;  //Pay for 30 hours work 
int excessHours;
double grosspay;
for(int j=0;j<7;j++){
    excessHours =workHours[j]-30;
    grosspay =fixedPay + excessHours*10.5;
    cout<<workers[j]+" gets " <<'#x27;<<grosspay<<endl;
}
    return 0;
}
Immanuel Immanuel Learn the language well then practice problems.



