CHAP01 - Chapter 1 Overview of Programming and Problem...

This preview shows pages 1–15. Sign up to view the full content.

1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 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
3 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 . . .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Programming Life Cycle Phases 1    Problem-Solving 2   Implementation 3    Maintenance
5 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

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Sample Problem     A programmer needs an algorithm to  determine an employee’s weekly  wages.  How would the calculations  be done by hand?
7 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

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 If hours are more than 40.0, then wages = (40.0 * payRate) + (hours - 40.0) * 1.5 *payRate otherwise,  wages = hours * payRate   Weekly Wages, in General    RECALL EXAMPLE          ( 40  x  \$ 24.75 ) + (  12 x 1.5 x \$ 24.75 ) = \$1435.50
9 An Algorithm is . . . a step-by-step procedure for solving a  problem in a finite amount of time.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10 Algorithm to Determine an Employee’s Weekly Wages 1. Get the employee’s hourly payRate 2. Get the hours worked this week 3. Calculate this week’s regular wages 4. Calculate this week’s overtime wages (if any) 5. Add the regular wages to overtime wages (if any) to determine total wages for the week
11 What is a Programming Language? It is a language with strict grammar  rules, symbols, and special words  used to construct a computer  program.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
12 Implementation Phase: Program translating your algorithm into a  programming language is called  CODING with  C++, you use Documentation -- your written comments Compiler -- translates your program into machine language Main Program -- may call subalgorithms
13 Implementation Phase: Test TESTING your program means running  (executing) your program on the  computer, to see if it produces correct  results if it does not, then you must find out  what is wrong with your program or  algorithm and fix it--this is called  debugging

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
14 Maintenance Phase
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 46

CHAP01 - Chapter 1 Overview of Programming and Problem...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online