Ask Question
28 November, 10:02

Jim is writing a program to calculate the wages of workers in a teddy bear factory.

The wages earned by a worker is either £2 for every teddy bear they have made or £5 for every hour they have worked, whichever is larger.

Write an algorithm that:

• allows the user to input the number of teddy bears made and the number of hours worked

• calculates the wages for the number of teddy bears made

• calculates the wages for the number of hours worked

• outputs the larger of the two results.

+1
Answers (1)
  1. 28 November, 10:22
    0
    The algorithm is as follows;

    1. Start

    2. Input TeddyBears

    3. Input Hours

    4. WagebyTeddy = 2 * TeddyBears

    5. WagebyHour = 5 * Hours

    6. If WagebyHour > WagebyTeddy then

    6.1 Print WagebyHour

    7. Else

    7.1. Print WagebyTeddy

    8. Stop

    Explanation:

    The following variables are used;

    TeddyBears - > Number of teddy bears made

    Hours - > Number of Hours worked

    WagebyTeddy - > Wages for the number of teddy bears made

    WagebyHour - > Wages for the number of hours worked

    The algorithm starts by accepting input for the number of teddy bears and hours worked from the user on line 2 and line 3

    The wages for the number of teddy bears made is calculated on line 4

    The wages for the number of hours worked is calculated on line 5

    Line 6 checks if wages for the number of hours is greated than wages for the number of bears made;

    If yes, the calculated wages by hour is displayed

    Otherwise

    the calculated wages by teddy bears made is displayed
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Jim is writing a program to calculate the wages of workers in a teddy bear factory. The wages earned by a worker is either £2 for every ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers