// 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
// 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
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images