Programming in C++ Programming Life Cycle Phases 1 Problem-Solving 2 Implementation 3 Maintenance
6 Programming Life Cycle Phases 1 Problem-Solving 2 Implementation 3 Maintenance
Programming in C++ Figure 1-1 Programming Process Analysis and specification General solution Concrete solution (algorithm) (program) Verify Maintenance phase PROBLEM-SOLVING PHASE MPLEMENTATION PHASE
7 Analysis and specification General Solution (algorithm) Verify Concrete solution (program) Test Maintenance phase Figure 1-1 Programming Process PROBLEM-SOLVING PHASE IMPLEMENTATION PHASE
Programming in C++ The First Step Problem-Solving Phase &ANALYZE the problem and SPECIFY what the solution must do %develop a GENERAL SOLUTION (ALGORITHM)to solve the problem &VERIFY that your solution really solves the problem
8 Problem-Solving Phase ❖ANALYZE the problem and SPECIFY what the solution must do ❖develop a GENERAL SOLUTION (ALGORITHM) to solve the problem ❖VERIFY that your solution really solves the problem The First Step
Programming in C++ Sample Problem A programmer needs an algorithm to determine an employee's weekly wages. How would the calculations be done by hand?
9 Sample Problem A programmer needs an algorithm to determine an employee’s weekly wages. How would the calculations be done by hand?
Programming in C++ One Employee's Wages In one week an employee works 52 hours at the hourly pay rate of $24.75 Assume a 40.0 hour normal work week and an overtime pay rate factor of 1.5 What are the emplovee's wages? 40x$24.75$990.00 12x1.5xS24.75=S445.50 s1435.50 10
10 One Employee’s Wages In one week an employee works 52 hours at the hourly pay rate of $24.75. Assume a 40.0 hour normal work week and an overtime pay rate factor of 1.5 What are the employee’s wages? 40 x $ 24.75 = $ 990.00 12 x 1.5 x $ 24.75 = $ 445.50 ___________ $ 1435.50