Unit 3 Algorithm IPO Charts

 

Use this file to complete the IPO charts for Chapter 9, Chapter 10, and Chapter 11.

 

This file will not be submitted for grading until all assignments are completed for the three chapters in Unit 3.

 

Following is the algorithm for the Chapter 9 Learning Tasks which is on page 366, problem 22.   Your objective is to re-order the steps listed below in the Algorithm .  You will use this file to complete the Unit 3 IPO Chart quiz.

 

grossPay9 (main)

 

Input

Processing

Output

Hours worked

Pay rate

Processing items:

 

Algorithm:

1.        Input hours worked.

2.       While hours worked is greater than or equal to zero

               Get pay rate.

               Call function getGrossPay.   The function returns Gross pay.

                      Output Gross Pay.

               Call function getTotal Gross.  The function returns Total gross pay.

             Input hours worked.

       End while

                 Output Total gross pay.

3.       Terminate the program.

Gross pay

Total gross pay

 

 

 

 

 

 

 

See getGrossPay() and getTotalGross() functions on next page

 

 

 

 

 

 

 

 

getGrossPay( )

 

Input

Processing

Output

Hours

Rate

Processing items:  none

Algorithm:

  1. If hours is less than or equal to 40

                       Calculate pay by multiplying hours times rate.

             Else

                        // worked overtime

                      Calculate pay by multiplying hours times rate plus (hours -40) times rate

                             divided by 2

  1. Return pay;

Pay

 

 

getTotalGross( )

Input

Processing

Output

Total

Gross

Processing items:  none

Algorithm:

  1. Accumulate total by adding total and gross.
  2. Return total.

Total

 

 

 

 

 

 

 

 

 

 

Following is the algorithm for the Chapter 10 Learning Tasks which is on page 412, problem 19.   Your objective is to re-order the steps listed below in the Algorithm .  You will use this file to complete the Unit 3 IPO Chart quiz.

 

grossPay10 main()

Input

Processing

Output

Hours worked

Pay rate

Processing items:

 

Algorithm:

1.       Input hours worked,

While hours worked is greater than or equal to zero

        Get pay rate.

        Call function calcGrossPay.   

        Output Gross Pay.

        Call function getTotalGross.  The function returns Total gross pay.

        Input hours worked.

End while

2.       Output Total gross pay.

3.       Terminate the program.

Gross pay

Total gross pay

 

 

 

 

 

 

 

 

 

 

 

 

See calcGrossPay() and getTotalGross() functions on next page

 

 

 

 

 

 

 

 

 

 

 

calcGrossPay()

 

Input

Processing

Output

Hours

Rate

Pay

Processing items:  none

Algorithm:

  1. If hours is less than or equal to 40

                       Calculate pay by multiplying hours times rate.

             Else

                        // worked overtime

                      Calculate pay by multiplying hours times rate plus (hours -40) times rate

                             divided by 2

 

none

 

 

 

getTotalGross ()

Input

Processing

Output

Total

Gross

Processing items:  none

Algorithm:

  1. Accumulate total by adding total and gross.
  2. Return total.

Total

 

 

 

 

 

 

 

Following is the algorithm for the Chapter 11 Learning Tasks which is on page 481, problem 27.   Your objective is to re-order the steps listed below in the Algorithm .  You will use this file to complete the Unit 3 IPO Chart quiz.


studentscore11

Input

Processing

Output

Twenty number stored in an array.

 

Processing items:

 

Algorithm:

1.       Input score to search for in the array.

2.       While score is greater than or equal to zero

3.        

               Initialize a counter variable to be zero.

                For integer variable starting at zero; Determine if variable is

                                      less than 20

                  If the number in the array is the number searching for

                           Accumulate total students by adding 1 to total

                End if

          Output number of student earning the certain score.

       End For

      Input score to search for in the array.

4.       End While.

5.       End main()

          

 

 

Total students earning a certain score.

 

 

 

 

 

               

 

    • 12 years ago
    Solution
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      4budbx71.zip