Writing modular programs with programmer-defined functions

In the payroll example that we used to illustrate programmer-defined functions, the hours and rate of pay the user enters are assigned to variables called hr and hw. Why are these not used in the function definition?

What would happen if the user accidently entered the hours worked in the rate of pay and the rate of pay in hours worked?


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.