A. draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter an hourly pay rate and hours worked. the program outputs the user's gross pay.

b. modify the program that computes gross pay to allow the user to enter the withholding tax rate. the program outputs the net pay after taxes have been withheld iframes not supported

Respuesta :

Pseudocode::

START
INPUT FLOAT hourlyPayRate
INPUT FLOAT hoursWorked
grossPay = hourlyPayRate*hoursWorked
OUTPUT grossPay
STOP

::

Modified Pseudocode::

START
INPUT FLOAT hourlyPayRate
INPUT FLOAT hoursWorked
INPUT taxRate
grossPay = hourlyPayRate*hoursWorked
netPay = grossPay*(100-taxRate/100)
OUTPUT netPay
STOP

::

N.B. I have used the data types Float, as it allows the user to enter decimal values, e.g. their hourly rate which may not be to the nearest value. Further, when calculating the net pay, I have simply multipled the gross pay by a tax multiplier (calculated by subtracting the tax rate from 100 - to find the remaining percentage - and dividing by 100 to get a decimal multiplier).

Flowcharts and pseudocodes are used as prototypes of a complete program.

Program A

The pseudocode that represents the logic of the program is as follows:

  • Start
  • Input hourlyRate
  • Input hoursWorked
  • gross = hourlyRate * hoursWorked
  • Display gross
  • End

Program B

The modified pseudocode that represents the logic of the program is as follows:

  • Start
  • Input hourlyRate
  • Input hoursWorked
  • Input tax
  • gross = hourlyRate * hoursWorked
  • Display gross
  • net = gross * (100 - tax/100)
  • End

Read more about flowcharts and pseudocodes at:

https://brainly.com/question/24735155

ACCESS MORE
EDU ACCESS