Answer:
for(i=0; i<4; i++)
{
for(j=0;j<6;j++)
{
A[ i ][ j ] = 2* i - 3*j;
}
}
Explanation:
In this loop for each i = 0,1,2,3 we fill the the corresponding column values. and then move to next i value i.e. row.
Answer:
The code is designed using C++ with comments
Explanation:
#include<bits/stdc++.h>
using namespace std;
int main(){
int pay, hours; //declaring hourly pay rate and number of hours worked
cout<<"Enter hourly pay rate: "<<endl; //taking user input
cin>>pay;
cout<<"Enter hours worked: "<<endl; //taking user input
cin>>hours;
int gross;
if (hours<=40){
gross=hours*pay; //calculating gross pay
}
else if (hours>40){
gross=40*pay+(hours-40)*1.5*pay; //calculating gross pay for overtime
}
int withholding, netpay;
//calculation of withholding..
if (gross>1000){
withholding=(gross*28)/100;
}
else if (gross>600 && gross<=1000){
withholding=(gross*21)/100;
}
else if (gross<=600){
withholding=(gross*10)/100;
}
netpay=gross-withholding; //calculation of netpay
cout<<"Gross pay is $"<<gross<<endl; //output
cout<<"Net pay is $"<<netpay<<endl; //output
return 0;
}