Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING

Size: px
Start display at page:

Download "Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING"

Transcription

1 Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING Computer programming BTI Compiled by SIA CHEE KIONG DEPARTMENT OF MATERIAL AND DESIGN ENGINEERING FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING

2 Content INTRODUCTION TO COMPUTER AND PROGRAMMING (2 hours) 1. Introduction To Computer And Programming, 2. Computer Evolution, 3. Software Development Life Cycle, 4. Top Down Design With Function Systems Structure, 5. Program Design Step And Methodology: - Structure Chart, - Flow Chart, - Pseudo Code, - Debugging And Documentation Techniques. 2

3 5.0 Algorithm The solution to any computing problem involves executing a series of actions in a specific order. A procedure for solving a problem in terms of 1. the actions to be executed, and 2. the order in which these action are to be executed Is called an algorithm 3

4 Algorithm In other word, A sequence of instructions is called an algorithm. Algorithms are a fundamental part of computing. There are two commonly used tools to help to document program logic (the algorithm). These are flowcharts and Pseudocode. Generally, flowcharts work well for small problems but Pseudocode is used for larger problems. 4

5 Algorithm properties Algorithm are not computer program, as they cannot be executed by a computer. Properties of algorithm are; 1. There must be no ambiguity in any instruction. 2. They should not be any uncertainty about which instruction is to be executed next. 3. The description of the algorithm must be finite. An algorithm cannot be open-ended. 4. The execution of the algorithm should conclude after a finite number of steps. 5. The algorithm must be general enough to deal with any contingency.

6 Overall V Algorithm can be represented by Pseudo-code Flowchart 6

7 5.1 Flowchart Some of the common symbols used in flowcharts are shown (right); With flowcharting, essential steps of an algorithm are shown using the shapes. The flow of data between steps is indicated by arrows, or flowlines. Terminator Input/output Process Decision Connector Preparation 7

8

9 Guidelines for preparing flowchart 1. The flowchart must be clear, neat and easy to follow. 2. The flowchart must have a logical start and finish. 3. In drawing a proper flowchart, all necessary requirements should be listed in logical order. 4. The direction of the flow of a procedure should always be from left to right or top to bottom. 5. Only one flow line should come out from a process symbol. Or

10 Guidelines for preparing flowchart (continue) 6. Only one flow line should enter a decision symbol. However, two or three flow line (one for each possible answer) may leave the decision symbol. < 0 > 0 7. Only one flow line used with terminal symbol = 0 Or

11 Guidelines for preparing flowchart (continue) 8. Within standard symbols, write briefly. If necessary, use the annotation symbol to describe data or process more clearly. SUM = A+B This process will add two numbers and store the value in SUM 9. In case of complex flowchart, connector symbols are use to reduce the number of flow lines. 10. Intersection of flow lines should avoided to make it a more effective and better way of representing communication. 11. It is useful to test the validity of the flowchart by passing through it with normal/unusual test data.

12 Algorithm/ flowchart (start the car engine) 1. Start 2. Insert the key 3. Free gear 4. Turn the key (start) 5. (a) If the engine start within 6 second, release the key to the ignition position. (b) If not start, repeat the step 4 and 5 (max 5 times). (c) If more than 5 times, call mechanics. 6. Finish Start Insert key Free gear Turn the key Engine started within 6 second Y Release the key to ignition position N N > 5 times Y Call mechanics Finish 12

13 Algorithm / flowchart (To library) 1. Start 2. Exit the room Start 3. If use bus, go to the nearest bus stand, wait the arrival of the bus and take bus to University. If use own vehicle, drive/ ride to the university. If not, walk to the university. Drive/ride to uni. Y Exit the room N N Take bus? Use own vehicle? Walk to uni. Y To bus stand wait Take bus 1 13

14 Continue Destination in library 5. If take lift a. Push the lift button b. wait the door open c. if the door open, i. enter and push the lift button ii. if not, use stair 6. Arrived 7. Finish Wait until reach the selected floor, exit if not wait. Destination in library. Use own vehicle? N Use stair Arrived Y N Push the lift button Wait the door open Lift door open? Y Enter and push the lift button Reach the selected floor Y Exit the lift N wait finish 14

15 Benefit of flowcharts 1. Makes logic clear 2. Communication 3. Effective analysis 4. Useful in coding 5. Proper testing and debugging 6. Appropriate documentation

16 Limitation of flowcharts 1. Complex; the major disadvantages in using flowcharts may continue for many pages, making them hard to follow. Flowchart tend to get large very quickly and it is difficult to follow the represented process. It is also very laborious to draw a flowchart for a larger program. 2. Costly; drawing a flowcharts a viable only if the problem solving logic is straight forward and not very lengthy. However, if flowcharts are drawn for a huge applications, the time and cost factor of program development may get out of proportional, making a costly affair. 3. Difficult to modify; due to its symbolic nature, any changes or modification to a flowchart usually require redrawing the entire logic again, and redrawing a complex flowchart is not a simple task. It is not easy to draw thousand of flow line and symbols along with proper spacing, especially for a large complex program. 4. No update; usually program are updated regularly. However, the corresponding the update of the flowchart may not take place, especially in a case of large programs. As a results, the logic used in the flowchart may not match with the actual program s logic. The inconsistency in flowchart update defeats the main purpose of the flowcharts, that is, to give the user the basic idea about the program s logic.

17 5.2 Pseudocode (pronounced soo-doh-kohd) Pseudocode is an artificial and informal language that helps you develop algorithms. Pseudocode is a "text-based" detail (algorithmic) design tool. The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented. These include while, do, for, if, switch. 17

18 Example -Pseudocode algorithm that uses sentinelcontrolled repetition to solve the class average problem 1. Initialize total to zero 2. Initialize counter to zero Input the first grade 5. While the user has not as yet entered the sentinel 6. Add this grade into the running total 7. Add one to the grade counter 8. Input the next grade (possibly the sentinel) If the counter is not equal to zero 11. Set the average to the total divided by the counter 12. Print the average 13. Else 14. Print No grade were entered) 18

19 Pseudocode Guideline Writing pseudocode is not difficult task. Even if you not know anything about the computer of computer language, you still can develop effective and efficient pseudocodes, if you write in an organized manner. Although there are no established standard for pseudocode construction, here are a few guidelines for developing pseudocodes. 1. Statement must be written in simple english (or any preferable language) and should be language independent. Remember that pseudocode only describe the logic plan to develop a program, it is not programming. 2. Steps must be understandable, and when the steps (instruction) are followed, they must produce a solution to a specified problem. If the pseudocode is difficult for a person to read or translate into code, then something is wrong with the level of detail you have chosen to use.

20 Pseudocode Guideline (continue) 3. Pseudocode should be concise. 4. Each instruction should be written in a separate line and each statement in pseudocode should express just one action for computer. If the task list is properly drawn, then in most cases each talk will correspond to one line of pseudocode. 5. Capitalise keywords such as READ, PRINT and so on. 6. Each set of instruction is written from top to bottom, with only one entry and one exit. 7. It should allow for easy transition from design to implementation in programming language.

21 Benefits of pseudocode 1. Since it language independent, it can be use by most programmers. It allows the developer to express the design in plan natural language. 2. It is easier to develop a program from a pseudocode than with a flowchart. Programmer do not have to think about syntaxes; they simply have to concentrate on the underlying logic. The focus is on the steps to solve a problem rather than on how to use the computer language. 3. Often, it is easy to translate pseudocode into a programming language, a step which can be accomplished by less experienced programmers.

22 Benefits of pseudocode (continue) The use of word and phrases in pseudocode, which are in line with basic computer operations, simplifies the translation from the pseudocode algorithm to a specific programming language. Unlike flowchart, pseudocode is compact and does to tend to run over many pages. Its simple structure and readability make it easier to modify. Pseudocode allow programmers who work in different computer languages to talk to each other. They can be reviewed by groups more easily than real code.

23 Limitations of pseudocode Although pseudocode is a very simple mechanism to simplify problem-solving logic, it has it limitations. Some of the notable limitation are; 1. the main disadvantages of using pseudocode is that it does not provide visual representation of the program s logic. 2. They are no accepted standards for writing pseudocodes. Programmer use their own style of writing pseudocode. 3. Pseudocode cannot be compiled nor executed, and there are no real formatting or syntax rules. It is simply one step, an important one, in producing the final code.

24 Flowchart and pseudocode in control structure. Repetition control structure. Sequence control structure. Selection control structure.

PROBLEM SOLVING AND OFFICE AUTOMATION. A Program consists of a series of instruction that a computer processes to perform the required operation.

PROBLEM SOLVING AND OFFICE AUTOMATION. A Program consists of a series of instruction that a computer processes to perform the required operation. UNIT III PROBLEM SOLVING AND OFFICE AUTOMATION Planning the Computer Program Purpose Algorithm Flow Charts Pseudo code -Application Software Packages- Introduction to Office Packages (not detailed commands

More information

UNIT-3 PROBLEM SOLVING AND OFFICE AUTOMATION

UNIT-3 PROBLEM SOLVING AND OFFICE AUTOMATION UNIT-3 PROBLEM SOLVING AND OFFICE AUTOMATION 1. PLANNING THE COMPUTER To solve a problem using computer, three phases are necessary. They are i. Identifying the purpose i. Identifying the purpose ii. Developing

More information

FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT III. 2 Marks PROBLEM SOLVING AND OFFICE AUTOMATION

FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT III. 2 Marks PROBLEM SOLVING AND OFFICE AUTOMATION FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING UNIT III 2 Marks PROBLEM SOLVING AND OFFICE AUTOMATION Planning the Computer Program Purpose Algorithm Flow Charts Pseudocode -Application Software Packages-

More information

Unit II. (i) Computer Programming Languages

Unit II. (i) Computer Programming Languages Unit II. (i) Computer Programming Languages Need of a computer programming language: A programming language is an artificial language designed to communicate instructions to a computer. Thousands of different

More information

SNS COLLEGE OF ENGINEERING,

SNS COLLEGE OF ENGINEERING, SNS COLLEGE OF ENGINEERING, COIMBATORE Department of Computer Science and Engineering QUESTION BANK(PART A) GE8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING TWO MARKS UNIT-I 1. What is computer? Computers

More information

PROBLEM SOLVING AND PYTHON PROGRAMMING

PROBLEM SOLVING AND PYTHON PROGRAMMING ALGORITHM UNIT-1 It is defined as a sequence of instructions that describe a method for solving a problem. In other words it is a step by step procedure for solving a problem. Properties of Algorithms

More information

بسم اهلل الرمحن الرحيم

بسم اهلل الرمحن الرحيم بسم اهلل الرمحن الرحيم Fundamentals of Programming C Session # 3 By: Saeed Haratian Spring 2016 Outlines Equality and Relational Operators A Simple C Program: Relations Keywords Algorithm Flow Chart Pseudo

More information

FLOW CHART AND PSEUDO CODE

FLOW CHART AND PSEUDO CODE FLOW CHART AND PSEUDO CODE Flowchart A Flowchart is a pictorial representation of an algorithm. The First flowchart is made by John Von Newman in 1945. It is a symbolic diagram of operation sequence, dataflow,

More information

Pseudo Code and Flow Charts. Chapter 1 Lesson 2

Pseudo Code and Flow Charts. Chapter 1 Lesson 2 Pseudo Code and Flow Charts Chapter 1 Lesson 2 Pseudocode Using Pseudocode Statements and Flowchart Symbols English-like representation of the logical steps it takes to solve a problem Flowchart Pictorial

More information

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha Computer Fundamentals Pradeep K. Sinha Priti Sinha Chapter 11 Planning the Chapter 11: Planning Computer the Program Program Slide 1/50 Learning Objectives In this chapter you will learn about: Programs

More information

ITEC102 INFORMATION TECHNOLOGIES

ITEC102 INFORMATION TECHNOLOGIES ITEC102 INFORMATION TECHNOLOGIES LECTURE 5 ALGORITHMS AND FLOW CHARTS EASTERN MEDITERRANEAN UNIVERSITY SCHOOL OF COMPUTING AND TECHNOLOGY Aim of the course Aim of this course to have information about,

More information

BIL101E: Introduction to Computers and Information systems Lecture 8

BIL101E: Introduction to Computers and Information systems Lecture 8 BIL101E: Introduction to Computers and Information systems Lecture 8 8.1 Algorithms 8.2 Pseudocode 8.3 Control Structures 8.4 Decision Making: Equality and Relational Operators 8.5 The if Selection Structure

More information

Flowchart Structure 25th October 2018

Flowchart Structure 25th October 2018 Flowchart Structure 25 th October 2018 Section 1: Basic rules in flowchart Section 2: Translating Pseudocode to Flowchart Algorithm Section3: Examples of Flowchart Section 4: Control structures (Sequence,

More information

depicts pictorially schematic representation of an algorithm document algorithms. used in designing or documenting

depicts pictorially schematic representation of an algorithm document algorithms. used in designing or documenting Definition A flowchart depicts pictorially the sequence in which instructions are carried out in an algorithm. A flowchart is a schematic representation of an algorithm or a stepwise process, showing the

More information

Notes By: Shailesh Bdr. Pandey, TA, Computer Engineering Department, Nepal Engineering College

Notes By: Shailesh Bdr. Pandey, TA, Computer Engineering Department, Nepal Engineering College FLOWCHARTING The flowchart is a means of visually presenting the flow of data through an information processing systems, the operations performed within the system and the sequence in which they are performed.

More information

Outline. Program development cycle. Algorithms development and representation. Examples.

Outline. Program development cycle. Algorithms development and representation. Examples. Outline Program development cycle. Algorithms development and representation. Examples. 1 Program Development Cycle Program development cycle steps: Problem definition. Problem analysis (understanding).

More information

Fundamentals of Programming. Lecture 6: Structured Development (part one)

Fundamentals of Programming. Lecture 6: Structured Development (part one) Fundamentals of Programming Lecture 6: Structured Development (part one) Instructor: Fatemeh Zamani f_zamani@ce.sharif.edu edu Sharif University of Technology Computer Engineering Department Outline Algorithms

More information

FLOWCHARTS A flowchart is a graphical representation of the steps to be followed for solving problem. It consists of a set of symbols.

FLOWCHARTS A flowchart is a graphical representation of the steps to be followed for solving problem. It consists of a set of symbols. FLOWCHARTS A flowchart is a graphical representation of the steps to be followed for solving problem. It consists of a set of symbols. Each symbol represents a specific activity. A typical problem involves

More information

Algorithms Flowcharts And Pseudocode An Algorithm Baking

Algorithms Flowcharts And Pseudocode An Algorithm Baking Algorithms Flowcharts And Pseudocode An Algorithm Baking We have made it easy for you to find a PDF Ebooks without any digging. And by having access to our ebooks online or by storing it on your computer,

More information

Structured Program Development in C

Structured Program Development in C 1 3 Structured Program Development in C 3.2 Algorithms 2 Computing problems All can be solved by executing a series of actions in a specific order Algorithm: procedure in terms of Actions to be executed

More information

The sequence of steps to be performed in order to solve a problem by the computer is known as an algorithm.

The sequence of steps to be performed in order to solve a problem by the computer is known as an algorithm. CHAPTER 1&2 OBJECTIVES After completing this chapter, you will be able to: Understand the basics and Advantages of an algorithm. Analysis various algorithms. Understand a flowchart. Steps involved in designing

More information

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

More information

Computer System and programming in C

Computer System and programming in C Approaches to Problem Solving Concept of algorithm and flow charts ALGORITHMS AND FLOWCHARTS A typical programming task can be divided into two phases: Problem solving phase produce an ordered sequence

More information

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University ITC213: STRUCTURED PROGRAMMING Bhaskar Shrestha National College of Computer Studies Tribhuvan University Lecture 02: Algorithms Readings: Not Covered in Textbook Problem Solving Process System Design:

More information

C++ Programming Language Lecture 2 Problem Analysis and Solution Representation

C++ Programming Language Lecture 2 Problem Analysis and Solution Representation C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Program Development Cycle Program development

More information

CS 199 Computer Programming. Spring 2018 Lecture 2 Problem Solving

CS 199 Computer Programming. Spring 2018 Lecture 2 Problem Solving CS 199 Computer Programming Spring 2018 Lecture 2 Problem Solving ALGORITHMS AND FLOWCHARTS A typical programming task can be divided into two phases: Problem solving phase produce an ordered sequence

More information

Chapter 3 Structured Program Development

Chapter 3 Structured Program Development 1 Chapter 3 Structured Program Development Copyright 2007 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 3 - Structured Program Development Outline 3.1 Introduction

More information

Engineering program development. Edited by Péter Vass

Engineering program development. Edited by Péter Vass Engineering program development Edited by Péter Vass Introduction Question: Why engineering program development may be useful for a PhD student in Earth Sciences? Counter-argument: In these days a wide

More information

Chapter Two: Program Design Process and Logic

Chapter Two: Program Design Process and Logic Chapter Two: Program Design Process and Logic 2.1 Chapter objectives Describe the steps involved in the programming process Understand how to use flowchart symbols and pseudocode statements Use a sentinel,

More information

CHAPTER 2 PROBLEM SOLVING TECHNIQUES. Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042

CHAPTER 2 PROBLEM SOLVING TECHNIQUES. Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042 CHAPTER 2 PROBLEM SOLVING TECHNIQUES Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042 Software Engineering vs Problem Solving Software Engineering - A branch of Computer Science & provides

More information

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode STUDENT OUTLINE Lesson 8: Structured Programming, Control Structures, if- Statements, Pseudocode INTRODUCTION: This lesson is the first of four covering the standard control structures of a high-level

More information

Problem Solving FLOWCHART. by Noor Azida Binti Sahabudin Faculty of Computer Systems & Software Engineering

Problem Solving FLOWCHART. by Noor Azida Binti Sahabudin Faculty of Computer Systems & Software Engineering Problem Solving FLOWCHART by Noor Azida Binti Sahabudin Faculty of Computer Systems & Software Engineering azida@ump.edu.my OER Problem Solving by Noor Azida Binti Sahabudin work is under licensed Creative

More information

Algorithms and Flowcharts

Algorithms and Flowcharts UNIT 2 Chapter 1 Algorithms and Flowcharts After studying this lesson, the students will be able to understand the need of Algorithm and Flowcharts; solve problems by using algorithms and flowcharts; get

More information

Steps to program development

Steps to program development Automate processes - Programming Concepts and Design Steps to program development A computer program is a set of formal instructions, which the computer executes in order to carry out some designated task.

More information

An Introduction to Programming with C++ Sixth Edition. Chapter 7 The Repetition Structure

An Introduction to Programming with C++ Sixth Edition. Chapter 7 The Repetition Structure An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure Objectives Differentiate between a pretest loop and a posttest loop Include a pretest loop in pseudocode Include

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 5 Structured Program Development Department of Computer Engineering How to develop

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 5 - Structured Program Development Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad How to develop a program? Requirements Problem Analysis

More information

Chapter 1: An Overview of Computers and Logic

Chapter 1: An Overview of Computers and Logic Chapter 1: An Overview of Computers and Logic Programming Logic and Design, Third Edition Comprehensive Objectives After studying Chapter 1, you should be able to: Understand computer components and operations

More information

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS INTRODUCTION TO PROBLEM SOLVING Introduction to Problem Solving Understanding problems Data processing Writing an algorithm CONTINUE.. Tool

More information

Introduction. C provides two styles of flow control:

Introduction. C provides two styles of flow control: Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if

More information

SNS COLLEGE OF ENGINEERING

SNS COLLEGE OF ENGINEERING SNS COLLEGE OF ENGINEERING DEPARTMENT OF CSE Presented By Thillaiarasu.N SCRAMBLE 2 Solution 3 What is Pseudocode? 4 Consists of: Short Readable Formally styled English language Used for: Explaining the

More information

Chapter 1: Problem Solving Skills Introduction to Programming GENG 200

Chapter 1: Problem Solving Skills Introduction to Programming GENG 200 Chapter 1: Problem Solving Skills Introduction to Programming GENG 200 Spring 2014, Prepared by Ali Abu Odeh 1 Table of Contents Fundamentals of Flowcharts 2 3 Flowchart with Conditions Flowchart with

More information

Stepwise Refinement. Lecture 12 COP 3014 Spring February 2, 2017

Stepwise Refinement. Lecture 12 COP 3014 Spring February 2, 2017 Stepwise Refinement Lecture 12 COP 3014 Spring 2017 February 2, 2017 Top-Down Stepwise Refinement Top down stepwise refinement is a useful problem-solving technique that is good for coming up with an algorithm.

More information

Engineering Computing M1H Together Towards A Green Environment

Engineering Computing M1H Together Towards A Green Environment Engineering Computing M1H321538 Module Induction Course Resources Lecture/Tutorial hours Course Syllabus Assessment Procedure Expectation from the Students General Terms and Conditions Course Resources

More information

Initial Coding Guidelines

Initial Coding Guidelines Initial Coding Guidelines ITK 168 (Lim) This handout specifies coding guidelines for programs in ITK 168. You are expected to follow these guidelines precisely for all lecture programs, and for lab programs.

More information

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen Computer Programming Computers can t do anything without being told what to do. To make the computer do something useful, you must give it instructions. You can give a computer instructions in two ways:

More information

Flowchart & Algorithm

Flowchart & Algorithm Flowchart & Algorithm 1 What is Algorithm? What is Flowchart? Write down the advantages and disadvantages. Compare them. Flowchart Flowchart is a pictorial or graphical representation of a process. Each

More information

Repetition Structures

Repetition Structures Repetition Structures Chapter 5 Fall 2016, CSUS Introduction to Repetition Structures Chapter 5.1 1 Introduction to Repetition Structures A repetition structure causes a statement or set of statements

More information

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution. Repetition Structures Introduction to Repetition Structures Chapter 5 Spring 2016, CSUS Chapter 5.1 Introduction to Repetition Structures The Problems with Duplicate Code A repetition structure causes

More information

Administration Computers Software Algorithms Programming Languages

Administration Computers Software Algorithms Programming Languages Administration Computers Software Algorithms Programming Languages http://www.cs.sfu.ca/cc/130/johnwill/ This course does not use Canvas John Edgar 3 Come to class Read ahead Attend the labs You get practice

More information

Algorithms (continued)

Algorithms (continued) Algorithms (continued) QUIZ What are the 3 (or 4) fundamental control structures that we use as building blocks for algorithms? Building blocks for algorithms Sequential Actions (input, output, computations)

More information

Working with Health IT Systems is available under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported license.

Working with Health IT Systems is available under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported license. Working with Health IT Systems is available under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported license. Johns Hopkins University. Welcome to the Fundamentals of Health Workflow

More information

Information Science 1

Information Science 1 Information Science 1 Fundamental Programming Constructs (1) Week 11 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 10 l Flow of control

More information

Information Science 1

Information Science 1 Topics covered Information Science 1 Fundamental Programming Constructs (1) Week 11 Terms and concepts from Week 10 Flow of control and conditional statements Selection structures if statement switch statement

More information

Unit 1: Algorithmic problem solving 1

Unit 1: Algorithmic problem solving 1 GE8151 PROBLEM SOLVING AND PYTHON PROGRAMMING UNIT I ALGORITHMIC PROBLEM SOLVING Algorithms, building blocks of algorithms (statements, state, control flow, functions), notation (pseudo code, flow chart,

More information

Homework #2. If (your ID number s last two digits % 6) = 0: 6, 12, 18

Homework #2. If (your ID number s last two digits % 6) = 0: 6, 12, 18 2005/Sep/19 1 Homework #2 Chapter 1: Exercises 7, 9 with modifications: for Exercise 7.a: 20 and 32 are changed as your ID number s last two digits and 60. for Exercise 9: 47x25 are change as 47x(your

More information

SOEE1160: Computers and Programming in Geosciences Semester /08. Dr. Sebastian Rost

SOEE1160: Computers and Programming in Geosciences Semester /08. Dr. Sebastian Rost SOEE1160 L3-1 Structured Programming SOEE1160: Computers and Programming in Geosciences Semester 2 2007/08 Dr. Sebastian Rost In a sense one could see a computer program as a recipe (this is pretty much

More information

A Quick Review of Chapter 1

A Quick Review of Chapter 1 A Quick Review of Chapter 1 The core of computing is algorithms Algorithm A well-ordered collection of unambiguous and effectively computable operations that, when executed, produces a result and halts

More information

COP 2000 Note Framework Chapter 5 - Repetition Page 1

COP 2000 Note Framework Chapter 5 - Repetition Page 1 COP 2000 Note Framework Chapter 5 - Repetition Page 1 The programming approach in which all problems are broken down using only three simple control structures, each of which has only one starting point

More information

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved. C How to Program, 6/e Before writing a program to solve a particular problem, it s essential to have a thorough understanding of the problem and a carefully planned approach to solving the problem. The

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 18 Switch Statement (Contd.) And Introduction to

More information

User Interface Programming OOP/Java Primer. Step 3 - documentation

User Interface Programming OOP/Java Primer. Step 3 - documentation User Interface Programming OOP/Java Primer Step 3 - documentation Department of Information Technology Uppsala University What is the documentation? Documentation about program in the program Clearly written

More information

Fundamentals of Health Workflow Process Analysis and Redesign

Fundamentals of Health Workflow Process Analysis and Redesign Fundamentals of Health Workflow Process Analysis and Redesign This material Comp10_Unit3b was developed by Duke University, funded by the Department of Health and Human Services, Office of the National

More information

Method & Tools for Program Analysis & Design

Method & Tools for Program Analysis & Design Method & Tools for Program Analysis & Design TMB208 Pemrograman Teknik Kredit: 3 (2-3) 1 Programming Logic and Design, Introductory, Fourth Edition 2 1 Programming Methods Based on structures of programming

More information

Computer Architecture

Computer Architecture Boaz Kantor Introduction to Computer Science, Fall semester 2009-2010 IDC Herzliya Computer Architecture I know what you're thinking, 'cause right now I'm thinking the same thing. Actually, I've been thinking

More information

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0 VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 L J Howell UX Software 2009 Ver. 1.0 TABLE OF CONTENTS INTRODUCTION...ii What is this book about?... iii How to use this book... iii

More information

Computing and compilers

Computing and compilers Computing and compilers Comp Sci 1570 to Outline 1 2 3 4 5 Evaluate the difference between hardware and software Find out about the various types of software Get a high level understanding of how program

More information

Problem Solving and Program Design - Chapter 1. Cory L. Strope

Problem Solving and Program Design - Chapter 1. Cory L. Strope Problem Solving and Program Design - Chapter 1 Cory L. Strope Overview of Computers and Programming Computer Hardware Computer Software Software Development (Problem Solving) Pseudocode Flowchart Intro.

More information

SME1013 PROGRAMMING FOR ENGINEERS

SME1013 PROGRAMMING FOR ENGINEERS SME1013 PROGRAMMING FOR ENGINEERS Ainullotfi bin Abdul Latif Faculty of Mechanical Engineering UTM Problem Solving Recognise and understand the problem (what is it that needed to be solved?) List the parameters

More information

Chapter 4 Introduction to Control Statements

Chapter 4 Introduction to Control Statements Introduction to Control Statements Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives 2 How do you use the increment and decrement operators? What are the standard math methods?

More information

Chapter 6 Programming the LC-3

Chapter 6 Programming the LC-3 Chapter 6 Programming the LC-3 Based on slides McGraw-Hill Additional material 4/5 Lewis/Martin Aside: Booting the Computer How does it all begin? We have LC-3 hardware and a program, but what next? Initial

More information

Visual Basic Course Pack

Visual Basic Course Pack Santa Monica College Computer Science 3 Visual Basic Course Pack Introduction VB.NET, short for Visual Basic.NET is a language that was first introduced by Microsoft in 1987. It has gone through many changes

More information

Problem Solving Footer Text 10/30/2015 1

Problem Solving Footer Text 10/30/2015 1 Problem Solving Footer Text 10/30/2015 1 Learning Outcome List five (5) steps in problem solving Identify input, process and output from a given problem. 8.2.2 Define algorithm. Solve a given problem using

More information

CMSC201 Computer Science I for Majors

CMSC201 Computer Science I for Majors CMSC201 Computer Science I for Majors Lecture 05 Algorithmic Thinking Last Class We Covered Decision structures One-way (using if) Two-way (using if and else) Multi-way (using if, elif, and else) Nested

More information

Individual research task. You should all have completed the research task set last week. Please make sure you hand it in today.

Individual research task. You should all have completed the research task set last week. Please make sure you hand it in today. Lecture 6 Individual research task. You should all have completed the research task set last week. Please make sure you hand it in today. Previously Decision structures with flowcharts Boolean logic UML

More information

1 Information system An information system is the combination of technology(computers) and people that enable an organization to collect data, store them, and transform them into information Data Data

More information

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION INTRODUCTION Programming Fundamentals Unit 1 In order to communicate with each other, we use natural languages like Bengali, English, Hindi, Urdu, French, Gujarati etc. We have different language around

More information

PROBLEM SOLVING AND PROGRAM. Looping statements Executing steps many times

PROBLEM SOLVING AND PROGRAM. Looping statements Executing steps many times PROBLEM SOLVING AND PROGRAM Looping statements Executing steps many times LOOPING What if there are a number of steps that must be done several times, would you re-write those steps for each time you needed

More information

Chapter 2 - Problem Solving

Chapter 2 - Problem Solving Chapter 2 - Problem Solving Program Development Cycle Programming Tools Chapter 2 - VB.NET by Schneider 1 Terminology tip A computer program may also be called: Project (Visual Studio 6 term) Application

More information

19 Machine Learning in Lisp

19 Machine Learning in Lisp 19 Machine Learning in Lisp Chapter Objectives Chapter Contents ID3 algorithm and inducing decision trees from lists of examples. A basic Lisp implementation of ID3 Demonstration on a simple credit assessment

More information

Unit 1: Introduction to Algorithms

Unit 1: Introduction to Algorithms 1 Unit 1: Introduction Unit 1: Introduction to Algorithms Steps involved in Problem Solving Problem solving by the computer involves the following steps 1. Problem definition 2. Analysis 3. Design 4. Coding

More information

Week 1 Introduction to Programming

Week 1 Introduction to Programming CME111 Programming Languages I Week 1 Introduction to Programming Assist. Prof. Dr. Caner ÖZCAN Introduction Course Web Site: www.canerozcan.net Office Hours: Tuesday 13:00-15:00 Wednesday 15:30-17:00

More information

Chapter Twelve. Systems Design and Development

Chapter Twelve. Systems Design and Development Chapter Twelve Systems Design and Development After reading this chapter, you should be able to: Describe the process of designing, programming, and debugging a computer program Explain why there are many

More information

CS111: PROGRAMMING LANGUAGE1. Lecture 2: Algorithmic Problem Solving

CS111: PROGRAMMING LANGUAGE1. Lecture 2: Algorithmic Problem Solving CS111: PROGRAMMING LANGUAGE1 Lecture 2: Algorithmic Problem Solving Agenda 2 Problem Solving Techniques Pseudocode Algorithm Flow charts Examples How People Solve Problems 3 A Problem exists when what

More information

Algorithms and Problem Solving

Algorithms and Problem Solving Algorithms and Problem Solving Introduction What is an Algorithm? Algorithm Properties Example Exercises Unit 16 1 What is an Algorithm? What is an Algorithm? An algorithm is a precisely defined and ordered

More information

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Introduction to Programming Language Concepts

More information

Java Coding 3. Over & over again!

Java Coding 3. Over & over again! Java Coding 3 Over & over again! Repetition Java repetition statements while (condition) statement; do statement; while (condition); where for ( init; condition; update) statement; statement is any Java

More information

CSC 121 Spring 2017 Howard Rosenthal

CSC 121 Spring 2017 Howard Rosenthal CSC 121 Spring 2017 Howard Rosenthal Agenda To be able to define computer program, algorithm, and highlevel programming language. To be able to list the basic stages involved in writing a computer program.

More information

S/W Programming & Languages

S/W Programming & Languages S/W Programming & Languages Overview Programming five steps Five generations High-level programming Object-oriented programming Internet programming 2 Programming What are the five steps of the programdevelopment

More information

UNIT-4 Black Box & White Box Testing

UNIT-4 Black Box & White Box Testing Black Box & White Box Testing Black Box Testing (Functional testing) o Equivalence Partitioning o Boundary Value Analysis o Cause Effect Graphing White Box Testing (Structural testing) o Coverage Testing

More information

CS187 - Science Gateway Seminar for CS and Math

CS187 - Science Gateway Seminar for CS and Math CS187 - Science Gateway Seminar for CS and Math Fall 2013 Class 6 Sep. 19, 2013 Programming and Programming Languages Why, How and What? A programming language is a formal language (vs. natural language)

More information

This activity will show you how to use Excel to draw cumulative frequency graphs. Earnings ( x/hour) 0 < x < x

This activity will show you how to use Excel to draw cumulative frequency graphs. Earnings ( x/hour) 0 < x < x Pay rates for men and women - Excel 2007 activity This activity will show you how to use Excel to draw cumulative frequency graphs. Information sheet The table gives the results from a survey about hourly

More information

Master of Computer Applications COMPUTER PROGRAMMING USING C

Master of Computer Applications COMPUTER PROGRAMMING USING C MCA03 KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Housefed Complex, Dispur, Guwahati - 781 006 Master of Computer Applications COMPUTER PROGRAMMING USING C CONTENTS UNIT- 1 : Introduction to Programming

More information

AP Computer Science A Syllabus

AP Computer Science A Syllabus AP Computer Science A Syllabus Course Overview The focus of this class is structured logic with an emphasis on developing simple, elegant algorithms and thinking in an object-oriented manner. The Java

More information

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java Chapter 1 Introduction to Computers and Java Objects Background information» important regardless of programming language Introduction to Java Chapter 1 Java: an Introduction to Computer Science & Programming

More information

Algorithms, Part 2 of 3. Topics Problem Solving Examples Pseudocode Control Structures

Algorithms, Part 2 of 3. Topics Problem Solving Examples Pseudocode Control Structures Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode Control Structures 1 Problem Solving Decode this sentence: Pdeo eo pda yknnayp wjosan. We have just come up with a specific solution to

More information

1. Introduction to Programming

1. Introduction to Programming Computer Science I CS 135 1. Introduction to Programming René Doursat Department of Computer Science & Engineering University of Nevada, Reno Fall 2005 Computer Science I CS 135 0. Course Presentation

More information

1007 Imperative Programming Part II

1007 Imperative Programming Part II Agenda 1007 Imperative Programming Part II We ve seen the basic ideas of sequence, iteration and selection. Now let s look at what else we need to start writing useful programs. Details now start to be

More information

Laboratory 5: Implementing Loops and Loop Control Strategies

Laboratory 5: Implementing Loops and Loop Control Strategies Laboratory 5: Implementing Loops and Loop Control Strategies Overview: Objectives: C++ has three control structures that are designed exclusively for iteration: the while, for and do statements. In today's

More information