To write a program to
solve the problem, we need to understand completely the input data required
and the output produced by that program. We may ask questions about the
nature, the format and the restrictions, if any, of the input
as well as the output.
The essential aim of writing
programs is to process the
input data into useful
output. It is always best to specify the output format at an early stage.
We can sketch or write what we want the output to look
like in its final form
when displayed on
screen or printed on paper.
~~~~
Problem analysis of the payroll problem ~~~~
INPUT
Hourly rate (real number) Number of hours worked (integer)
OUTPUT
Daily wage of an employee (real number)
OUTPUT FORMAT
Enter number of hours worked: 8 Enter hourly rate: 40 Daily wage is $336.00
Enter number of hours worked: 5 Enter hourly rate: 30 Daily wage is $150.00