SlideShare a Scribd company logo
Computer Programming Computer Programming
 Hardware: Electronic Devices
 Software: Instructions and Computer
Programs
 Input : Keyboard, Mouse
 System unit:
 Random Access Memory (RAM)
 Central Processing Unit (CPU)
 Output: Monitor, Printer
 Secondary Storage: Disk Drive
 Instructions for the hardware.
 Actions to be performed
 A set of instructions is called a program.
 Driving force behind the computer
 Without a program –What is a computer?
▪ Collection of Useless Hardware
 2 purposes:
 Tell the computer what to do
 Tell other people what we want the computer to
do.
 The central processing unit (CPU)
 The “brain” of a computer
 Retrieves instructions from memory and
executes them.
 Stores data and program instructions for CPU
to execute
 A program and its data must be brought to
memory before they can be executed
 Stores intermediate and final results of
processing.
 Volatile: Contents are erased when computer
is turned off or reset.
 A memory unit is an ordered sequence of
bytes, each holds eight bits.
 A byte is the minimum storage unit.
 No two data can share or split the same byte.
 Devices are Hard Drives, CDs/DVDs, Flash
Drives, etc.
 Non-Volatile or Permanent Storage
 Programs and data are permanently stored
on storage devices and are moved to memory
when the computer actually uses them.
 Core operational units of digital devices have
two stable states,
 which are referred to as zero and one by convention
 Combinations of different units with different
states are represented with the binary number
system
 0 and 1.
 A single digit (0 or 1) is called a bit, represents either
of binary states.
 Binary Language
 Data and instructions are encoded as binary
numbers - a series of bits
 one or more bytes made up of zeros and ones
 Encoding and decoding of data into binary is
performed automatically by the system
based on the encoding scheme
 Encoding schemes
 Numeric Data: Encoded as binary numbers
 Non-Numeric Data: Encoded as binary numbers
using representative code
▪ ASCII – 1 byte per character (character means symbol)
▪ Unicode – 2 bytes per character
 Base 10, ten digits (0-9)
 The position (place) values are integral powers of
10:
 100(ones), 101(tens), 102(hundreds), 103(thousands)…
 (372)10 = 3 × 102 + 7 × 101 + 2 × 100
= 3 × 100 + 7 × 10 + 2 × 1
= 300 + 70 + 2
 n decimal digits - 10n unique values
 Base 2, two digits (0-1)
 The position (place) values are integral powers of
2:
 20(1), 21(2), 22(4), 23(8), 24(16), 25(32), 26(64)…
 (101)2 = 1 × 22 + 0 × 21 + 1 × 20
= 1 × 4 + 0 × 2 + 1 × 1
= 4 + 0 + 1
= (5)10
 n binary digits - 2n unique values
Computer Programming Computer Programming
 Computers can not use human languages,
 Programming in the binary language of
computers is a very difficult, tedious process
 Therefore, most programs are written using a
programming language
 are converted to the binary language used by the
computer
 Three major categories of programming
languages:
 Machine Language
 Assembly Language
 High level Language
 Natural language of a particular computer
 Primitive instructions built into every
computer
 The instructions are in the form of binary
code
 Any other types of languages must be
translated down to this level
 English-likeAbbreviations used for
operations (Load R1, R8)
 Assembly languages were developed to make
programming easier
 The computer cannot understand assembly
language
 - a program called assembler is used to convert
assembly language programs into machine code
 English-like and easy to learn and program
 Common mathematical notation
 area = radius * radius * 3.1415;
 Java, C, C++, FORTRAN,VISUAL BASIC,
PASCAL
A program written in a high-level language is called a
source program (or source code). Since a computer cannot
understand a source program. Program called a compiler is
used to translate the source program into a machine
language program called an object program.The object
program is often then linked with other supporting library
code before the object can be executed on the machine.
19
Compiler
Source File Object File Linker Excutable File
 Programming – the creation of an ordered set of
instructions to solve a problem with a computer.
 Only about 100 instructions that the computer
understands - Different programs will just use
these instructions in different orders and
combinations.
 The most valuable part of learning to program is
learning how to think about arranging the
sequence of instructions to solve the problem or
carry out the task
 Sequential Processing
 A List of Instructions
 Conditional Execution
 if / else
 Repetition
 Looping / Repeating
 Stepwise Refinement /Top-Down Design
 BreakingThings into Smaller Pieces
 Calling Methods / Functions / Procedures / Subroutines
 Calling a segment of code located elsewhere
 Reuse of previously coded code segment
 Procedural
 Defining set of steps to transform inputs into outputs
 Translating steps into code
 Constructed as a set of procedures
 Each procedure is a set of instructions
 Object-Oriented
 Defining/utilizing objects to represent real-world entities that
work together to solve problem
 Basic O-O Programming Components
▪ Class
▪ Object/Instance
▪ Properties
▪ Methods
 The process of defining a problem, searching for
relevant information and resources about the
problem, and of discovering, designing, and
evaluating the solutions for further
opportunities. Includes:
 Finding an Answer to a Question
 Figuring out how to Perform aTask
 Figure out how to MakeThingsWork
 Not enough to know a particular programming
language… Must be able to problem solve…
 Read the Problem: Understand the
description of problem or scenario,
identifying the knowns and unkowns
 Decide how to go about solving the problem:
Determine what steps need to be taken to
reach the solution
 Solve the Problem: Write the solution
 Test the Answer: Make sure the answer is
correct
 In general, when we solve a computing
problem we are taking some inputs,
processing (performing some actions on) the
inputs, and then outputting the solution or
results.
 This is the classic view of computer
programming – computation as calculation
 Polya’s steps (UDIE) can be very effective
when applied to solving computing problems
Computer Programming Computer Programming
 What is the Problem to be solved?What is the
unknown?What is the condition?What is the
data?What is needed to solve the problem?
What actions need to take place?
 Identify the inputs and outputs
 Identify the processes needed to produce the
outputs from the given inputs
 Draw a figure. Introduce suitable notation.
 Isolate Principle parts of the problem.
 Find connections between the knowns and
unknowns.
 Simplify: Break the problem into smaller sub-
problems
 Design a solution
 Make a plan or list of actions to implement
the solution
 Algorithm / Flowchart / Psuedocode
 Algorithm
 A FINITE set of clear, executable steps that will eventually
terminate to produce the desired outcome
 Logical design used to solve problems – usually a list of
actions required to perform task
 Pseudocode
 Written like program code but more “English Like” and
doesn’t have to conform to language syntax
 Flowchart
 Diagram that visually represents the steps to be performed
to arrive at solution.
 Implement in a Programming Language
 Carry out the plan checking the preliminary
results at each step.
 Code A LittleTest A lot
 Run the Code
 Check results repeatedly and thoroughly
 Use numerous test cases or data sets
 Use highly varied test case, including expected as
well as and unexpected cases
 Look for new solutions
 Is there a better, easier, or more efficient solution
 Can other problems be solved using these
techniques?
35
 Tools are used to convert algorithms into
computer programs:
 Flowchart - Graphically depicts the logical steps to
carry out a task and shows how the steps relate to
each other.
 Pseudocode - Uses English-like phrases with some
programming terms to outline the program.
36
 How many stamps do you use when mailing a
letter?
 One rule of thumb is to use one stamp for
every five sheets of paper or fraction thereof.
37
1. Request the number of sheets of paper; call it
Sheets. (input)
2. Divide Sheets by 5. (processing)
3. Round the quotient up to the next highest
whole number; call it Stamps. (processing)
4. Reply with the number Stamps. (output)
38
 Graphically depict the logical steps to carry
out a task and show how the steps relate to
each other.
39
40
41
42
 Uses English-like phrases to outline the
task.
43
Determine the proper number of stamps for a
letter
Read Sheets (input)
Set the number of stamps to Sheets / 5 (processing)
Round the number of stamps up to the next
whole number (processing)
Display the number of stamps (output)
44
 Used in problem solving – take a large
problem and break it into smaller problems
solving the small ones first
 Breaks a problem down into modules
45
 Sequence – follow instructions from one line to
the next without skipping over any lines
 Decision - if the answer to a question is “Yes”
then one group of instructions is executed. If
the answer is “No,” then another is executed
 Looping – a series of instructions are executed
over and over
46
47
48
49
 Problem: Given a street number of a one-way
street in NewYork City, decide the direction
of the street, either eastbound or westbound
 Discussion: in NewYork City even numbered
streets are Eastbound, odd numbered streets
areWestbound
50
51
Program: Determine the direction of a numbered NYC
street
Get street
If street is evenThen
Display Eastbound
Else
Display Westbound
End If
52
 Problem: Calculate and report the grade-point
average for a class
 Discussion: The average grade equals the sum of all
grades divided by the number of students
Output: Average grade
Input: Student grades
Processing: Find the sum of the grades; count the
number of students; calculate average
53
54
Program: Determine the average grade of a class
Initialize Counter and Sum to 0
DoWhile there are more data
Get the next Grade
Add the Grade to the Sum
Increment the Counter
Loop
ComputerAverage = Sum / Counter
Display Average
 U - Read the Problem Statement
 Identify the inputs, outputs, and processes
 D - Decide how to Solve the Problem
 Create an Algorithm / Flowchart / Psuedocode
 I - Program the Code
 Implement in Programming Language
 E -Test the Solution
 Run the Code using numerous, varied test cases
Using Polya’s first 2 steps, understand and devise a solution to the
following problem:
 Determine the week’s earnings for an employee
from the hourly pay rate and hours worked for the
week. Report the gross earnings (including
overtime earnings) for the week.
 Definitions:
 Overtime hours = hours over 40
 Overtime pay rate = 1.5 * reg pay rate
Using Polya’s first 2 steps, understand and devise a solution to the
following problem:
Determine the week’s earnings for an employee from
the hourly pay rate, total hours for the week and
tax rate. Report the number of reg hours, overtime
hours, gross reg earnings, gross overtime earnings,
tax witheld, and total net earnings for the week.
Definitions:
 Overtime hours = hours over 40
 Overtime pay rate = 1.5 * reg pay rate
 Write an algorithm to serve as how-to
instructions for some relatively simple task or
activity. You choose the task, should be 10-20
steps in length. Assume you are writing
instructions for someone who has never
performed task before.

More Related Content

PPT
Programming languages
PPTX
Software Testing Strategies ,Validation Testing and System Testing.
PPTX
Programming Fundamental Slide No.1
PDF
Compiler question bank
PPTX
introduction to programming languages
PPT
Chapter 13 software testing strategies
PPT
Presentation on Programming Languages.
PPT
Introduction to Compiler design
Programming languages
Software Testing Strategies ,Validation Testing and System Testing.
Programming Fundamental Slide No.1
Compiler question bank
introduction to programming languages
Chapter 13 software testing strategies
Presentation on Programming Languages.
Introduction to Compiler design

What's hot (20)

PPTX
classification of computer language
PPSX
Programming languages
PPTX
Introduction to ICT - lecture 1
PPTX
Computer Software
PPTX
Software cost estimation techniques presentation
PDF
Lecture 3 basic syntax and semantics
PPT
Intro To Programming Concepts
PPT
Programing Fundamental
PPTX
Programming language
PPTX
Introduction to Programming Languages
PDF
Application software
PPT
High level and Low level Language
PPTX
Types of Programming Languages
PPTX
Operating system and its functions
PDF
Cyclomatic complexity
PPTX
Programming languages
PPTX
PPT
Lect 1. introduction to programming languages
PPT
Generation of computer languages
PPTX
Language and Processors for Requirements Specification
classification of computer language
Programming languages
Introduction to ICT - lecture 1
Computer Software
Software cost estimation techniques presentation
Lecture 3 basic syntax and semantics
Intro To Programming Concepts
Programing Fundamental
Programming language
Introduction to Programming Languages
Application software
High level and Low level Language
Types of Programming Languages
Operating system and its functions
Cyclomatic complexity
Programming languages
Lect 1. introduction to programming languages
Generation of computer languages
Language and Processors for Requirements Specification
Ad

Similar to Computer Programming Computer Programming (20)

PPT
computer programming introduction ppt.ppt
PPTX
UNIT-1.pptx python for engineering first year students
PPTX
Introduction.pptx
PPTX
Pj01 1-computer and programming fundamentals
PPT
Data structures & problem solving unit 1 ppt
PPT
(Prog213) (introduction to programming)v1
PPT
Data sources with unified method and pulbish tes
PPTX
Cs1123 2 comp_prog
PPTX
Lecture-1.pptx . this is about the computer program
PDF
Chap 1 c++
PDF
Algorithm.pdf
PDF
structured programming Introduction to c fundamentals
PPTX
C programming .pptx
PPTX
Unit 1 c programming language Tut and notes
PDF
L1. Basic Programming Concepts.pdf
DOCX
Lecture1
PDF
BCA 1st semester Problem Solving Notes using C.pdf
PPT
Program logic and design
PPSX
CC-112-Lec.1.ppsx
PPT
programming language(C++) chapter-one contd.ppt
computer programming introduction ppt.ppt
UNIT-1.pptx python for engineering first year students
Introduction.pptx
Pj01 1-computer and programming fundamentals
Data structures & problem solving unit 1 ppt
(Prog213) (introduction to programming)v1
Data sources with unified method and pulbish tes
Cs1123 2 comp_prog
Lecture-1.pptx . this is about the computer program
Chap 1 c++
Algorithm.pdf
structured programming Introduction to c fundamentals
C programming .pptx
Unit 1 c programming language Tut and notes
L1. Basic Programming Concepts.pdf
Lecture1
BCA 1st semester Problem Solving Notes using C.pdf
Program logic and design
CC-112-Lec.1.ppsx
programming language(C++) chapter-one contd.ppt
Ad

Recently uploaded (20)

PDF
Digital Logic Computer Design lecture notes
PDF
Well-logging-methods_new................
PPTX
Sustainable Sites - Green Building Construction
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Construction Project Organization Group 2.pptx
PDF
PPT on Performance Review to get promotions
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
web development for engineering and engineering
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Mechanical Engineering MATERIALS Selection
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
Digital Logic Computer Design lecture notes
Well-logging-methods_new................
Sustainable Sites - Green Building Construction
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
OOP with Java - Java Introduction (Basics)
Construction Project Organization Group 2.pptx
PPT on Performance Review to get promotions
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Foundation to blockchain - A guide to Blockchain Tech
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
web development for engineering and engineering
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Internet of Things (IOT) - A guide to understanding
bas. eng. economics group 4 presentation 1.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Mechanical Engineering MATERIALS Selection
Model Code of Practice - Construction Work - 21102022 .pdf

Computer Programming Computer Programming

  • 2.  Hardware: Electronic Devices  Software: Instructions and Computer Programs
  • 3.  Input : Keyboard, Mouse  System unit:  Random Access Memory (RAM)  Central Processing Unit (CPU)  Output: Monitor, Printer  Secondary Storage: Disk Drive
  • 4.  Instructions for the hardware.  Actions to be performed  A set of instructions is called a program.  Driving force behind the computer  Without a program –What is a computer? ▪ Collection of Useless Hardware  2 purposes:  Tell the computer what to do  Tell other people what we want the computer to do.
  • 5.  The central processing unit (CPU)  The “brain” of a computer  Retrieves instructions from memory and executes them.
  • 6.  Stores data and program instructions for CPU to execute  A program and its data must be brought to memory before they can be executed  Stores intermediate and final results of processing.  Volatile: Contents are erased when computer is turned off or reset.
  • 7.  A memory unit is an ordered sequence of bytes, each holds eight bits.  A byte is the minimum storage unit.  No two data can share or split the same byte.  Devices are Hard Drives, CDs/DVDs, Flash Drives, etc.  Non-Volatile or Permanent Storage  Programs and data are permanently stored on storage devices and are moved to memory when the computer actually uses them.
  • 8.  Core operational units of digital devices have two stable states,  which are referred to as zero and one by convention  Combinations of different units with different states are represented with the binary number system  0 and 1.  A single digit (0 or 1) is called a bit, represents either of binary states.
  • 9.  Binary Language  Data and instructions are encoded as binary numbers - a series of bits  one or more bytes made up of zeros and ones
  • 10.  Encoding and decoding of data into binary is performed automatically by the system based on the encoding scheme  Encoding schemes  Numeric Data: Encoded as binary numbers  Non-Numeric Data: Encoded as binary numbers using representative code ▪ ASCII – 1 byte per character (character means symbol) ▪ Unicode – 2 bytes per character
  • 11.  Base 10, ten digits (0-9)  The position (place) values are integral powers of 10:  100(ones), 101(tens), 102(hundreds), 103(thousands)…  (372)10 = 3 × 102 + 7 × 101 + 2 × 100 = 3 × 100 + 7 × 10 + 2 × 1 = 300 + 70 + 2  n decimal digits - 10n unique values
  • 12.  Base 2, two digits (0-1)  The position (place) values are integral powers of 2:  20(1), 21(2), 22(4), 23(8), 24(16), 25(32), 26(64)…  (101)2 = 1 × 22 + 0 × 21 + 1 × 20 = 1 × 4 + 0 × 2 + 1 × 1 = 4 + 0 + 1 = (5)10  n binary digits - 2n unique values
  • 14.  Computers can not use human languages,  Programming in the binary language of computers is a very difficult, tedious process  Therefore, most programs are written using a programming language  are converted to the binary language used by the computer
  • 15.  Three major categories of programming languages:  Machine Language  Assembly Language  High level Language
  • 16.  Natural language of a particular computer  Primitive instructions built into every computer  The instructions are in the form of binary code  Any other types of languages must be translated down to this level
  • 17.  English-likeAbbreviations used for operations (Load R1, R8)  Assembly languages were developed to make programming easier  The computer cannot understand assembly language  - a program called assembler is used to convert assembly language programs into machine code
  • 18.  English-like and easy to learn and program  Common mathematical notation  area = radius * radius * 3.1415;  Java, C, C++, FORTRAN,VISUAL BASIC, PASCAL
  • 19. A program written in a high-level language is called a source program (or source code). Since a computer cannot understand a source program. Program called a compiler is used to translate the source program into a machine language program called an object program.The object program is often then linked with other supporting library code before the object can be executed on the machine. 19 Compiler Source File Object File Linker Excutable File
  • 20.  Programming – the creation of an ordered set of instructions to solve a problem with a computer.  Only about 100 instructions that the computer understands - Different programs will just use these instructions in different orders and combinations.  The most valuable part of learning to program is learning how to think about arranging the sequence of instructions to solve the problem or carry out the task
  • 21.  Sequential Processing  A List of Instructions  Conditional Execution  if / else  Repetition  Looping / Repeating  Stepwise Refinement /Top-Down Design  BreakingThings into Smaller Pieces  Calling Methods / Functions / Procedures / Subroutines  Calling a segment of code located elsewhere  Reuse of previously coded code segment
  • 22.  Procedural  Defining set of steps to transform inputs into outputs  Translating steps into code  Constructed as a set of procedures  Each procedure is a set of instructions  Object-Oriented  Defining/utilizing objects to represent real-world entities that work together to solve problem  Basic O-O Programming Components ▪ Class ▪ Object/Instance ▪ Properties ▪ Methods
  • 23.  The process of defining a problem, searching for relevant information and resources about the problem, and of discovering, designing, and evaluating the solutions for further opportunities. Includes:  Finding an Answer to a Question  Figuring out how to Perform aTask  Figure out how to MakeThingsWork  Not enough to know a particular programming language… Must be able to problem solve…
  • 24.  Read the Problem: Understand the description of problem or scenario, identifying the knowns and unkowns  Decide how to go about solving the problem: Determine what steps need to be taken to reach the solution  Solve the Problem: Write the solution  Test the Answer: Make sure the answer is correct
  • 25.  In general, when we solve a computing problem we are taking some inputs, processing (performing some actions on) the inputs, and then outputting the solution or results.  This is the classic view of computer programming – computation as calculation  Polya’s steps (UDIE) can be very effective when applied to solving computing problems
  • 27.  What is the Problem to be solved?What is the unknown?What is the condition?What is the data?What is needed to solve the problem? What actions need to take place?  Identify the inputs and outputs  Identify the processes needed to produce the outputs from the given inputs  Draw a figure. Introduce suitable notation.  Isolate Principle parts of the problem.
  • 28.  Find connections between the knowns and unknowns.  Simplify: Break the problem into smaller sub- problems  Design a solution  Make a plan or list of actions to implement the solution  Algorithm / Flowchart / Psuedocode
  • 29.  Algorithm  A FINITE set of clear, executable steps that will eventually terminate to produce the desired outcome  Logical design used to solve problems – usually a list of actions required to perform task  Pseudocode  Written like program code but more “English Like” and doesn’t have to conform to language syntax  Flowchart  Diagram that visually represents the steps to be performed to arrive at solution.
  • 30.  Implement in a Programming Language  Carry out the plan checking the preliminary results at each step.  Code A LittleTest A lot
  • 31.  Run the Code  Check results repeatedly and thoroughly  Use numerous test cases or data sets  Use highly varied test case, including expected as well as and unexpected cases  Look for new solutions  Is there a better, easier, or more efficient solution  Can other problems be solved using these techniques?
  • 32. 35  Tools are used to convert algorithms into computer programs:  Flowchart - Graphically depicts the logical steps to carry out a task and shows how the steps relate to each other.  Pseudocode - Uses English-like phrases with some programming terms to outline the program.
  • 33. 36  How many stamps do you use when mailing a letter?  One rule of thumb is to use one stamp for every five sheets of paper or fraction thereof.
  • 34. 37 1. Request the number of sheets of paper; call it Sheets. (input) 2. Divide Sheets by 5. (processing) 3. Round the quotient up to the next highest whole number; call it Stamps. (processing) 4. Reply with the number Stamps. (output)
  • 35. 38  Graphically depict the logical steps to carry out a task and show how the steps relate to each other.
  • 36. 39
  • 37. 40
  • 38. 41
  • 39. 42  Uses English-like phrases to outline the task.
  • 40. 43 Determine the proper number of stamps for a letter Read Sheets (input) Set the number of stamps to Sheets / 5 (processing) Round the number of stamps up to the next whole number (processing) Display the number of stamps (output)
  • 41. 44  Used in problem solving – take a large problem and break it into smaller problems solving the small ones first  Breaks a problem down into modules
  • 42. 45  Sequence – follow instructions from one line to the next without skipping over any lines  Decision - if the answer to a question is “Yes” then one group of instructions is executed. If the answer is “No,” then another is executed  Looping – a series of instructions are executed over and over
  • 43. 46
  • 44. 47
  • 45. 48
  • 46. 49  Problem: Given a street number of a one-way street in NewYork City, decide the direction of the street, either eastbound or westbound  Discussion: in NewYork City even numbered streets are Eastbound, odd numbered streets areWestbound
  • 47. 50
  • 48. 51 Program: Determine the direction of a numbered NYC street Get street If street is evenThen Display Eastbound Else Display Westbound End If
  • 49. 52  Problem: Calculate and report the grade-point average for a class  Discussion: The average grade equals the sum of all grades divided by the number of students Output: Average grade Input: Student grades Processing: Find the sum of the grades; count the number of students; calculate average
  • 50. 53
  • 51. 54 Program: Determine the average grade of a class Initialize Counter and Sum to 0 DoWhile there are more data Get the next Grade Add the Grade to the Sum Increment the Counter Loop ComputerAverage = Sum / Counter Display Average
  • 52.  U - Read the Problem Statement  Identify the inputs, outputs, and processes  D - Decide how to Solve the Problem  Create an Algorithm / Flowchart / Psuedocode  I - Program the Code  Implement in Programming Language  E -Test the Solution  Run the Code using numerous, varied test cases
  • 53. Using Polya’s first 2 steps, understand and devise a solution to the following problem:  Determine the week’s earnings for an employee from the hourly pay rate and hours worked for the week. Report the gross earnings (including overtime earnings) for the week.  Definitions:  Overtime hours = hours over 40  Overtime pay rate = 1.5 * reg pay rate
  • 54. Using Polya’s first 2 steps, understand and devise a solution to the following problem: Determine the week’s earnings for an employee from the hourly pay rate, total hours for the week and tax rate. Report the number of reg hours, overtime hours, gross reg earnings, gross overtime earnings, tax witheld, and total net earnings for the week. Definitions:  Overtime hours = hours over 40  Overtime pay rate = 1.5 * reg pay rate
  • 55.  Write an algorithm to serve as how-to instructions for some relatively simple task or activity. You choose the task, should be 10-20 steps in length. Assume you are writing instructions for someone who has never performed task before.