Chapter 1 Powerpoint

# 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 pages 1–14. Sign up to view the full content.

1 Chapter 1 Overview of Programming and Problem Solving Slides based on work 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. Assembly Language vs. High Level Languages Compilation and Execution Processes C++ History Basic Control Structures 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 Problem-Solving Implementation 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    Suppose a programmer needs 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   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 An  algorithm  is   a step-by-step procedure  for solving a problem  with a finite amount of data 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? programming language  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
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
Ask a homework question - tutors are online