Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using this code for C++ using DEVC++ could you please correct for errors goal is to covert my previos program to arrays and set maxsize

using this code for C++ using DEVC++ could you please correct for errors goal is to covert my previos program to arrays and set maxsize of array to 100

#include

#include

#include

//phase4b

main(){

char maritalstatus[100],firstname[100][10],lastname[100][15];

float overtime,overtimepay,regularpay,overtimepaycalc,hoursworked[100];

int employeeid[100],mynumber,anumber;

float hourlyrate[100],grosspay,taxamount,netpay;

float TAXRATE;

overtime=0;

overtimepay=0;

regularpay=0;

mynumber=0;

anumber=0;

cout<<"Enter First Name: ";

while(cin>>firstname[mynumber]&&mynumber<100){

cout<<"Enter Last Name: ";

cin>>lastname[mynumber];

cout<<"Enter Employee ID: ";

cin>>employeeid[mynumber];

cout<<"Enter Hours Worked: ";

cin>>hoursworked[mynumber];

cout<<"Hourly Rate: ";

cin>>hourlyrate[mynumber];

cout<<"Enter S,or M,or H: ";

cin>>maritalstatus[mynumber];

cout<<"Enter First Name: ";

mynumber=mynumber+1;

}//end of loop

cout<<" Payroll Program "<

cout<<"FirstName LastName Stat ID HW OTH OTP REG GROSS TAX NET"<

cout<<"========= ======== ==== == == === === === ==== == ==="<

while(anumber

{

grosspay=hoursworked[anumber]*hourlyrate[anumber];

if(hoursworked[anumber]>40)

{

overtime=hoursworked[anumber]-40;

regularpay=40*hourlyrate[anumber];

overtimepaycalc=hourlyrate[anumber]*1.5f;

overtimepay=overtime*overtimepaycalc;

grosspay=overtimepay+regularpay;

}

if(grosspay>500)

TAXRATE=.30f;

else if(grosspay>200)

TAXRATE=.20f;

else

TAXRATE=.10f;

if(maritalstatus[anumber]=='S')

TAXRATE=TAXRATE*1.05F;

else if(maritalstatus[anumber]=='M')

TAXRATE=TAXRATE*.85f;

else if(maritalstatus[anumber]=='H')

TAXRATE=TAXRATE*.95F;

taxamount=grosspay*TAXRATE;

netpay=grosspay-taxamount;

setprecision(2);

cout<

<

<

<

<

<

<

<

<

<

<

ami,ber=anumber+1

}//WHILE

return 0;

}//MAIN

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

Students also viewed these Databases questions

Question

Listen for sales opportunities in what the customer says.

Answered: 1 week ago

Question

1. The evaluation results can be used to change the program.

Answered: 1 week ago

Question

5. To determine the financial benefits and costs of the program.

Answered: 1 week ago