Chapter 1 Powerpoint - Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin Community College of Baltimore

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

View Full Document Right Arrow Icon
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work 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. Assembly Language vs. High Level Languages Compilation and Execution Processes C++ History Basic Control Structures 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 Problem-Solving Implementation 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    Suppose a programmer needs 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   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 An  algorithm  is   a step-by-step procedure  for solving a problem  with a finite amount of data 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? programming language  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
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/21/2011 for the course CSC 140 taught by Professor Lebre during the Spring '04 term at Moraine Valley Community College.

Page1 / 51

Chapter 1 Powerpoint - Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin Community College of Baltimore

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online