nerdexam
CompTIA

FC0-U61 · Question #814

A developer is writing a program to process a long list of employees and apply a cost-of-living increase of 3.2% to all employees making less than $15 per hour. Which of the following pseudocode snipp

The correct answer is B. For all employees in the list making less than $15 per hour employeesalary = employeesalary *. This pseudocode snippet correctly implements the requirement to apply a cost-of-living increase to employees making less than $15 per hour. By using a loop (For all employees in the list), it ensures that every employee meeting the condition (making less than $15 per hour) will h

Software Development

Question

A developer is writing a program to process a long list of employees and apply a cost-of-living increase of 3.2% to all employees making less than $15 per hour. Which of the following pseudocode snippets provides the best solution?

Options

  • AIf employeesalary is greater than $15 per hour employeesalary = employeesalary * 1.032
  • BFor all employees in the list making less than $15 per hour employeesalary = employeesalary *
  • CIf employeesalary is less than $15 per hour employeesalary = employeesalary * 3.2
  • DFor all employees in the list making greater than $15 per hour employeesalary = employeesalary

How the community answered

(58 responses)
  • A
    3% (2)
  • B
    81% (47)
  • C
    12% (7)
  • D
    3% (2)

Explanation

This pseudocode snippet correctly implements the requirement to apply a cost-of-living increase to employees making less than $15 per hour. By using a loop (For all employees in the list), it ensures that every employee meeting the condition (making less than $15 per hour) will have their salary adjusted by multiplying it by 1.032. This approach efficiently processes each relevant entry just once and applies the necessary increase accurately.

Topics

#pseudocode#programming logic#loops#conditional statements

Community Discussion

No community discussion yet for this question.

Full FC0-U61 Practice