Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Write the pseudocode for one contiguous NESTED IF structure for the problem?

Write the pseudocode for one contiguous NESTED IF structure for the problem

described below. Use a separate piece of paper on which to write your answer.

Be sure to use IF-ELSE-ENDIF notation. NOTE: Do NOT code a series of stand-

alone IF statements. (Zero points will be given if you do)

Remember: Most computers execute the logic of a nested-IF faster than checking

each of a series of stand-alone IF statements. The problem below is not as difficult

as it may appear. In effect, the logic has already been clustered in the verbiage.

PROBLEM:

If an employee works the NIGHT-SHIFT (e.g. IF SHIFT == "NIGHT"),

multiply the PAY-RATE by .09 and store the answer in PAY-INCREASE.

If an employee does NOT work the NIGHT-SHIFT, is a UNION member

(UNION == 'Y'), and MONTHS-EMPLOYED > 24 then PAY-INCREASE

= PAY-RATE * .08.

If an employee does NOT work the NIGHT-SHIFT, is a UNION member (UNION

== 'Y'), and MONTHS-EMPLOYED <= 24, PAY-INCREASE = PAY-RATE * .07

If an employee does NOT work the NIGHT-SHIFT, is NOT a UNION member,

and MONTHS-EMPLOYED > 24, then PAY-INCREASE = PAY-RATE * .06

If an employee does NOT work the NIGHT-SHIFT, is NOT a UNION member, and

MONTHS-EMPLOYED <= 24, then PAY-INCREASE = PAY-RATE * .05.

2 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    If SHIFT=NIGHT Then

    Set PAY_INCREASE=PAY_RATE*.09

    Else If UNION=Y And MONTHS_EMPLOYED>24 Then

    Set PAY_INCREASE=PAY_RATE*.08

    Else If UNION=Y And MONTHS_EMPLOYED<=24 Then

    Set PAY_INCREASE=PAR_RATE*.07

    Else If UNION=N And MONTHS_EMPLOYED>24 Then

    PAY_INCREASE=PAY_RATE*.06

    Else

    PAY_INCREASE=PAY-RATE*.05

    ENDIF

    ENDIF

    ENDIF

    ENDIF

    Source(s): can visit my blog "amitasuri.wordpress.com" for more queries and learning'
  • 4 years ago

    Nested If Structure

Still have questions? Get your answers by asking now.