Programming in c++ Author. Nell Dale Chip Weems Mark Headington Published By Higher Education Press Jones and Bartlett Publishers Dale/eems/Headington
1 Author: Nell Dale Chip Weems Mark Headington Published By Higher Education Press Jones and Bartlett Publishers
Programming in c++ Instructor: Yu Ruiguo E-mail:gyu@tju.edu.cn Assistant: Li QingSen E-mail:qingsenli@eyou.com Dale/eems/Headington
2 Instructor: Yu RuiGuo E-mail:rgyu@tju.edu.cn Assistant: Li QingSen E-mail:qingsenli@eyou.com
Programming in c++ Overview of Programming and Problem Solving Dale/eems/Headington
3 Overview of Programming and Problem Solving
Programming in C++ Chapter 1 Topics o Computer Programming %Programming Life-Cycle Phases Creating an Algorithm 8 Machine Language vs High Level Languages Compilation and Execution Processes 心C++ History Computer Components Computing Profession Ethics Problem-Solving Techniques
4 Chapter 1 Topics ❖Computer Programming ❖Programming Life-Cycle Phases ❖Creating an Algorithm ❖Machine Language vs. High Level Languages ❖Compilation and Execution Processes ❖C++ History ❖Computer Components ❖Computing Profession Ethics ❖Problem-Solving Techniques
Programming in C++ What is Computer Programming? olt is the process of planning a sequence of steps(called instructions) for a computer to follow STEP 1 STEP 2 STEP 3
5 What is Computer Programming? ❖It is the process of planning a sequence of steps (called instructions) for a computer to follow. STEP 1 STEP 2 STEP 3 . .
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