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

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

View Full Document Right Arrow Icon
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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 . . .
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Programming Life Cycle Phases 1    Problem-Solving 2   Implementation 3    Maintenance
Background image of page 4
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
Background image of page 5

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

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

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
9 An Algorithm is . . . a step-by-step procedure for solving a  problem in a finite amount of time.
Background image of page 9

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

View Full DocumentRight Arrow Icon
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
Background image of page 10
11 What is a Programming Language? It is a language with strict grammar  rules, symbols, and special words  used to construct a computer  program.  
Background image of page 11

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

View Full DocumentRight Arrow Icon
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
Background image of page 12
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
Background image of page 13

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

View Full DocumentRight Arrow Icon
14 Maintenance Phase
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online