INTRODUCTION TO PROGRAMMING. Program Development Life Cycle The program development life cycle is a model that describes the stages involved in a program.

Slides:



Advertisements
Similar presentations
INFORMATION TECHNOLOGY
Advertisements

Andrew C. Samuels, Information Technology Specialist Trainer c/o Ministry of Education Mona High School, Kingston, Jamaica 1 Problem Solving Section 2:
Data Dependencies Describes the normal situation that the data that instructions use depend upon the data created by other instructions, or data is stored.
SDLC Software Development Life Cycle. SDLC Acronym for system development life cycle. Acronym for system development life cycle. Is the process of developing.
ALGORITHMS AND FLOWCHARTS
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 3: Primitive Data Types.
Unit 171 Algorithms and Problem Solving  Introduction  Algorithm Design  Algorithm Properties  Algorithm Control Flow  Examples  Comparing Algorithms.
Computer Science 1620 Programming & Problem Solving.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
7.2 System Development Life Cycle (SDLC)
PRE-PROGRAMMING PHASE
Business Math Assignment Press F5 to begin to playing this slide show.
Software Engineering 1 (Chap. 1) Object-Centered Design.
ALGORITHMS AND FLOWCHARTS
Adapted from slides by Marie desJardins
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
U NDERSTANDING P ROBLEMS AND HOW TO S OLVE THEM BY USING C OMPUTERS.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Algorithmic Problem Solving CMSC 201 Adapted from slides by Marie desJardins (Spring 2015 Prof Chang version)
Developing an Algorithm
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Homework Assignment #3 J. H. Wang Apr. 19, 2007.
Developing an Algorithm
CPS120 Introduction to Computer Programming The Programming Process.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
Systems Analysis and Design
Writing Program Code in BASIC Write a program to prompt for and accept values into TWO variables, numx and numy. The program should square the value stored.
Test and Review chapter State the differences between archive and back-up data. Answer: Archive data is a copy of data which is no longer in regular.
Scratch Programming Lesson 4 Question asking and answering.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Procedural Programming. Programming Process 1.Understand the problem 2.Outline a general solution 3.Decompose the general solution into manageable component.
EXERCISES for ALGORITHMS WRITING
Programming, an introduction to Pascal
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Developing an Algorithm. Simple Program Design, Fourth Edition Chapter 3 2 Objectives In this chapter you will be able to: Introduce methods of analyzing.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding the Three Basic Structures Structure: a basic unit of programming logic Any program.
The Hashemite University Computer Engineering Department
Concepts of Algorithms CSC-244 Unit Zero Pseudo code, Flowchart and Algorithm Master Prince Computer College Qassim University K.S.A.
CS 141 Computer Programming 1 Branching Statements.
Algorithms and Pseudocode
GCSE ICT 3 rd Edition The system life cycle 18 The system life cycle is a series of stages that are worked through during the development of a new information.
ALGORITHMS AND FLOWCHARTS. A typical programming task can be divided into two phases: Problem solving phase  produce an ordered sequence of steps that.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
10-1 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
PROBLEM SOLVING. What is a Problem? A problem is a situation that needs to be resolved.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Getting Ready for the NOCTI test April 30, Study checklist #1 Analyze Programming Problems and Flowchart Solutions Study Checklist.
MANAGEMENT INFORMATION SYSTEM
INTRODUCTION TO PROBLEM SOLVING
Step 1:Identify and Define the problem
GC211Data Structure Lecture2 Sara Alhajjam.
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
Algorithms and Flowcharts
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Lecture 2 Introduction to Programming
Introduction To Flowcharting
Algorithm and Ambiguity
ALGORITHMS AND FLOWCHARTS
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING CSC 111.
Understanding the Three Basic Structures
ALGORITHMS AND FLOWCHARTS
Chapter 5: Control Structure
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Basic Concepts of Algorithm
Presentation transcript:

INTRODUCTION TO PROGRAMMING

Program Development Life Cycle The program development life cycle is a model that describes the stages involved in a program development project, from an initial feasibility study through maintenance of the completed program. The program development life cycle can be summarized as:  Analysis  Design  Testing  Implementation  Maintenance

Analysis In this phase the existing system is evaluated. Deficiencies are identified. This can be done by interviewing users of the system and consulting with support personnel. The new system requirements are defined. In particular, the deficiencies in the existing system must be addressed with specific proposals for improvement.

Design The proposed system is designed. Plans are laid out concerning the hardware, operating systems, programming, communications and security issues. The new system is developed. The new components and programs must be obtained and installed.

Testing Once the new system is developed, all aspects of performance must be tested. Testing should ensure that the system not only responds correctly to valid data but also deals with invalid data. If necessary, adjustments can be made at this stage.

Implementation The new system is put into use. The new system can be phased in, according to application or location and the old system gradually replaced. In some cases, it may be more cost-effective to shut down the old system and implement the new system all at once. Users of the new system must be trained in its use.

Maintenance Once the new system is up and running for a while, it should be exhaustively evaluated. Maintenance must be kept rigorously at all times. Users of the system should be kept up-to-date concerning the last modifications and procedures.

ANALYSIS AND ALGORTIHM DESIGN - I

Analyzing the problem In order to write a program to accomplish a certain task you must analyze the task as a sequence of instructions that can be performed by the computer. These instructions can be divided into three main parts:  Input and Storage Instructions  Processing Instructions  Output Instructions

Input and Storage instructions These instructions allow data to be accepted by the computer. The input is information that is needed by the computer to solve the problem. Words such as ‘Enter’, ‘Input’ and ‘Read’ within problem statements usually indicate what data the computer requires.

Input and Storage instructions Example 1 What are the input and storage instructions here? 1)Read the price of an item and calculate the discount of 10%. 2)Enter the name and year of birth of a person and calculate the person’s age. 3)Input the length of a side of a square tile and find the area.

Input and Storage instructions Let’s analyze these instructions to determine the inputs and what we need to store. 1)Read and store the price of an item 2) Enter the name and year of a birth of a person 3) Input the length of the side of a square tile

Processing instructions These instructions manipulate the input data. They involve calculations that is, mathematical operations (e.g. addition, subtraction, multiplication and division), repeating instructions, selecting instructions and comparison instructions. They also include commands and constructs.

Processing instructions A command is a word that instructs the computer what must be done to accomplish a specific task. Commands are specific to a particular programming language: for example WRITE, PRINT, READ, INPUT etc.

Processing instructions A construct is a group of instructions that work together with commands to accomplish a specific task. An example is the ‘IF-THEN’ construct: Example: IF a < 10 THEN READ Num ENDIF

Problem statements that contain the words ‘calculate’, ‘compute’, ‘convert’, ‘add’, ‘sum’, ‘subtract’, ‘minus’, ‘multiply’, ‘divide’, ‘percentage’, ‘average’, indicate what needs to be done. Problem statements can also imply what needs to be processed by looking at what results are required for output. For example : Print the area of the room’. Processing instructions

Example 2 What are the processing instructions here? 1)Read the price of an item and calculate the new price after a 10% discount. 2) Enter a temperature in degrees Celsius and convert it to degrees Fahrenheit. 3) Input the name and year of birth and compute and print the age of a person.

Processing instructions Let’s analyze these instructions to determine what we need to process. 1)Calculate the new price after a 10% discount. 2) Convert it to degrees Fahrenheit. 3) Compute the age of a person.

Processing instructions Comparison statements and repeat statements Comparison/selection/decision statements involve determining whether a condition is true or false in order to perform a set of instructions.

Processing instructions Comparison statements and repeat statements For example: Read the weekly hours worked by an employee. If the hours worked are greater than 40, then calculate overtime salary at 1.5 times the standard hourly rate of $8.50, for those over 40. The condition that is checked is the number of hours worked to determine if it is more than 40.

Processing instructions Comparison statements and repeat statements Repeat statements/loopings/iterations are used when a problem has to be done a number of times. For example: Read the marks for three subjects, English, Maths and Spanish, for each student; find the average mark of each student in a class of 15, over the three subjects. The process of finding the average for the three subjects has to be repeated 15 times.

Output instructions These instructions allow information to be displayed on the screen. Problem statements that include key words like ‘print’, ‘output’, ‘display’, ‘return’ and ‘write’, indicate what data should be output to the screen. Example 3 What are the output statements here? 1)Enter the name and year of birth of a person and compute and display the age of the person. 2)Write an algorithm to print a conversion table of °C to °F, 10°C to 20°C inclusive.

Output instructions Let’s analyze these instructions to determine what we need to output. 1)Display the age of the person 2) Print a conversion table

Examples Let’s analyze a few problems. Example 4 Write a program to enter the base and the height of a triangle and find and print the area. Input & StorageProcessingOutput Base Height Calculate Area Area=(Base*Height)/2 Area

Examples Example 5 Write a program to read the temperature in degrees Celsius (°C) and convert it to degrees Fahrenheit (°F) where F=32+(9C/5). Output the temperature in degrees Celsius and Fahrenheit. Input & StorageProcessingOutput CCalculate Fahrenheit F= 32 + (9C/5) CFCF

Examples Example 6 Write a program to read the answer to the sum 10*12. (The answer is 120.) Return the comment “Correct” if the answer is right and “Incorrect” if the answer is wrong. Input & StorageProcessingOutput AnswerIf Answer = 120 then print “Correct” otherwise print “Incorrect” “Correct” or “Incorrect”

Examples Example 7 Write a program that reads the result of 10 games played by a team and find the percentage of games won by the team. Output the percentage games won. Input & Storage ProcessingOutput GameResultRepeat 10 times Read GameResult, add 1 to TotalWins if GameResult is a “Win” PercentageWins=(TotalWins/ 10)*100 PercentageWins

Examples Example 8 A school has a house system implemented. Points are awarded to a house based on the performance of its members. 1 st place – 4 points, 2 nd place – 3 points, 3 rd place – 2 points, 4 th place - 1 point, and last place – no points awarded. Read the names of 10 members of the Aripo house and the place they came on the events; calculate and print the total points awarded to the house.

Examples Input & Storage ProcessingOutput Name Place Repeat 10 times Check Place If Place = 1 then add 4 to Total If Place = 2 then add 3 to Total If Place = 3 then add 2 to Total If Place = 4 then add 1 to Total Total