// Main module Module main() // Local variables Declare Real rate, hours   // Get the rate of pay. Call getRate(rate)   // Get the hours worked. Call getHours(hours)   // Show the gross pay. Call showGrossPay(rate, hours)   End Module   // The getRate module gets the pay rate. Module getRate(Real Ref amount) // Get the pay rate.      Display "Enter hourly pay rate." Input amount        // Validate the pay rate.      While amount < 7.50 OR amount > 18.25           Display "Pay rate must be between 7.50 and 18.25."           Display "Enter a valid pay rate."           Input amount      End While End Module   // The getHours module gets hours worked. Module getHours(Real Ref hours)      // Get the hours worked.      Display "Enter hours worked:"      Input hours        // Validate the hours.      While hours < 0 OR hours > 40           Display "Hours must be between 0 and 40!"           Display "Enter a valid number."           Input hours      End While End Module   // The showGrossPay module shows gross pay. Module showGrossPay(Real rate, Real hours) Declare Real gross        // Calculate the gross pay. Set gross = rate * hours   // Display the gross pay, Display "Employee gross pay: $", gross End Module Flowchart please

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

// Main module

Module main()

// Local variables

Declare Real rate, hours

 

// Get the rate of pay.

Call getRate(rate)

 

// Get the hours worked.

Call getHours(hours)

 

// Show the gross pay.

Call showGrossPay(rate, hours)

 

End Module

 

// The getRate module gets the pay rate.

Module getRate(Real Ref amount)

// Get the pay rate.

     Display "Enter hourly pay rate."

Input amount

 

     // Validate the pay rate.

     While amount < 7.50 OR amount > 18.25

          Display "Pay rate must be between 7.50 and 18.25."

          Display "Enter a valid pay rate."

          Input amount

     End While

End Module

 

// The getHours module gets hours worked.

Module getHours(Real Ref hours)

     // Get the hours worked.

     Display "Enter hours worked:"

     Input hours

 

     // Validate the hours.

     While hours < 0 OR hours > 40

          Display "Hours must be between 0 and 40!"

          Display "Enter a valid number."

          Input hours

     End While

End Module

 

// The showGrossPay module shows gross pay.

Module showGrossPay(Real rate, Real hours)

Declare Real gross

 

     // Calculate the gross pay.

Set gross = rate * hours

 

// Display the gross pay,

Display "Employee gross pay: $", gross

End Module

Flowchart please

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning