Show Create Mobile Computer App Using C Code Include Required Header Files Include Include Q43785069
Show how to create a mobile/computer app using the c++ codebelow
#include <iostream> // required header files
#include <string>
#include <iomanip>
using namespace std;
int main() // driver method
{
cout << “This program calculates the net pay forthe each employee and the gross pay.” << endl; // promptabout the code
cout << “nAt each prompt, enter the requesteddata.” << endl;
double payRate, workedHrs, regPay, otPay, grossPay,tx, netPay, totGrossPay = 0, totNetPay = 0, totTax = 0, totalPay =0; // local varaibles
int empCount = 0;
char empCode, stateCode, choice;
while(true) { // iterate till the user desire toexit
empCount++; // count of theemployess gets incremented
cout << “nEnter the pay rate: “; // prompt to enter the pay rate
cin >> payRate; // get thepay rate
cout << “Enter the number ofhours worked : “; // prompt to enter the hours
cin >> workedHrs; // get thedata
cout << “Enter the EmployeeCode (A or B) : “; // prompt to enter the emp code
cin >> empCode; // get thedata
cout << “Enter the state code(Y or J) : “; // prompt to enter the state code
cin >> stateCode; // get thedata
if(workedHrs <= 40) { // checkfor the worked hours
regPay = payRate* workedHrs; // calculate the amount
otPay = 0;
} else {
regPay = payRate* 40;
payRate =payRate * 1.5;
otPay = payRate* (workedHrs – 40); // calculate the Overtime
}
cout.precision(2); // set theprecision of the console to 2 digits
cout << “nRegular Pay : “<< setw(8) << fixed << regPay << endl; //print the data
cout << “Overtime Pay : “<< setw(7) << fixed << otPay << endl; //print the data
grossPay = regPay + otPay; //calculate the gross pay
cout << “Gross Pay : “<< setw(10) << fixed << grossPay << endl;// print the data
totalPay = regPay + otPay; //calculate the total pay
totGrossPay = totGrossPay +grossPay; // calculate the total gross pay
if(empCode == ‘A’) { // claculatethe tax payable
if(stateCode ==’Y’) {
tx = totalPay * 0.07;
} else if(stateCode == ‘J’) {
tx = totalPay * 0.045;
}
} else if(empCode == ‘B’) {
tx = 0;
}
cout << “Tax : ” <<setw(16) << fixed << tx << endl; // print thedata
totTax = totTax + tx;
cout <<“——————————–” << endl;
netPay = grossPay – tx; //calculate the net pay
totNetPay = totNetPay +netPay;
cout << “Net Pay : ” <<setw(11) << fixed << netPay << endl; // print thedata
cout << “nDo you want toprocess another employee (y or n) : “; // get the choice for thenext user to enter
cin >> choice; // get thedata
if(choice == ‘n’) { // check forthe choice
break;
} else {
continue;
}
}
cout << “nTotal Number of Employees Processed :” << empCount << endl; // print the resultantdata
cout << “Total Gross Pay : ” << setw(8)<< fixed << totGrossPay << endl;
cout << “Total Tax : ” << setw(14)<< fixed << totTax << endl;
cout << “Total Net Pay : ” << setw(10)<< fixed << totNetPay << endl;
return 0;
}
Expert Answer
Answer to Show how to create a mobile/computer app using the c++ code below #include // required header files #include #include us…
OR