1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Overview of Programming and Problem Solving ROBERT REAVES.
Chapter 1 - An Introduction to Computers and Problem Solving
ITEC113 Algorithms and Programming Techniques
Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY at Fredonia Room 210, Fenton ,
This set of slides is provided by the author of the textbook1 Introductory Topics (Continued) l Computer Components l Basic Control Structures l Problem.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
1 Chapter 1 Introduction to Object-Oriented Programming.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
Algorithm Design CS105. Problem Solving Algorithm: set of unambiguous instructions to solve a problem – Breaking down a problem into a set of sub- problems.
Computer Science 1620 Programming & Problem Solving.
Programming Fundamentals (750113) Ch1. Problem Solving
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Chapter 3 Planning Your Solution
1 Author: Nell Dale Chip Weems Mark Headington Published By Higher Education Press Jones and Bartlett Publishers.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
CSE 1340 Introduction to Computing Concepts Class 2.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
CHAPTER 1 Overview of Programming and Problem Solving.
1 Overview of Programming and Problem Solving Chapter 1.
The Software Development Life Cycle. Software Development SDLC The Software Development Life-Cycle Sometimes called the program development lifecycle.
Overview of Programming and Problem Solving. Objectives In this chapter you will: Learn about different types of computers Explore the hardware and software.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Overview of Programming and Problem Solving Textbook Chapter 1 1.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
CPS120 Introduction to Computer Programming The Programming Process.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
Chapter 1 Overview of Programming and Problem Solving 1.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
CC112 Structured Programming Lecture 1 1 Arab Academy for Science and Technology and Maritime Transport College of Engineering and Technology Computer.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1 Overview of Programming and Problem Solving CS185/09 - Introduction to Programming Caldwell College.
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
1 Overview of Programming Principles of Computers.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
ICS 3UI - Introduction to Computer Science
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Algorithm and Ambiguity
An Introduction to Visual Basic .NET and Program Design
Foundations of Computer Science
Chapter 1 Introduction(1.1)
What is Computer Programming?
Algorithm and Ambiguity
Computer Science Core Concepts
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
ICT Gaming Lesson 2.
Basic Concepts of Algorithm
Programming Logic and Design Eighth Edition
Presentation transcript:

1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course

2 Course Goals Introduce General concepts of Programming Begin to Think Like a Programmer Start Programming With C (a powerful, widely-used programming language) Become Junior C Programmer

3 Course Outline An introduction to computer programming Problem solving skills and software development methods Data types, operators and simple functions Selection structure (IF and Switch statements) Repetition and loop statements Function & modular programming Arrays & applications Multidimensional arrays

4 Overview of Computer, Programming and Problem Solving Dr. Sherif Mohamed Tawfik Lecture One

5 Lecture One Outline Overview of Computer, Programming and Problem Solving What is Programming? Programming Life-Cycle Phases Algorithm Basic Control Structures Sample problem

6 Device capable of performing computations and enacting logical decisions Perform these tasks millions and even billions of times faster than people can Computers process data through sets of instructions called computer programs Programs guide the computer through actions as specified by people called computer programmers; For this course, that will be YOU. Background What is a Computer?

7 Background Computer Components

8 What is Programming? 1.Find an algorithm to solve a problem. 2.Express that algorithm in a way that the computer can execute it. Given a well-defined problem:

9 Programming Life Cycle Phases 1.Analyze the problem. This involves identifying the data you have to work with it, the desired results, and any additional requirements or constrains on the solution. 2.Design the algorithm to solve the problem. An algorithm is a step-by-step procedure for solving a problem in a finite amount of time. 3.Implement the algorithm. Each algorithm is converted into one or more steps in a programming language. This process is called CODING.

10 Programming Life Cycle Phases 4.Test and verify the completed program. Run the program several times using different sets of data, making sure that it works correctly for every situation in the algorithm. if it does not work correctly, then you must find out what is wrong with your program or algorithm and fix it--this is called DEBUGGING 5.Maintain and update the program. maintenance begins when your program is put into use and accounts for the majority of effort on most programs. MODIFY the program to meet changing requirements or correct errors that show up in using it.

11 Algorithm Basic Control Structures a sequence is a series of statements that execute one after another selection (branch) is used to execute different statements depending on certain conditions Looping (repetition) is used to repeat statements while certain conditions are met. a subprogram is used to break the program into smaller units

12 Statement... Control Structures Sequences

13 IF Condition THEN Statement1 ELSE Statement2 Statement1 Statement Statement2 Condition... True False Control structures Selection (Branching)

14 Statement Condition... False True WHILE Condition Statement1 Control structures Loop (Repetition)

15 PROGRAM1... SUBPROGRAM1 a meaningful collection of SEQUENCE, SELECTION, LOOP, SUBPROGRAM Control structures Subprogram (Function)

16 A small company needs an interactive program to figure its weekly payroll. The payroll clerk will input data for each employee, and each employee’s wages. Display the total wages for the week on the screen. Sample Problem Company payroll case study

17 Sample Problem A programmer needs an algorithm to determine an employee’s weekly wages. How would the calculations be done by hand?

18 Algorithm for Company Payroll Program initialize total company payroll to 0.0 repeat this process for each employee: 1. Get the employee’s ID empNum 2. Get the employee’s hourly payRate 3. Get the hours worked this week 4. Calculate this week’s wages 5. Add wages to total company payroll write total company payroll on screen

19 If hours are more than 40.0, then wages = (40.0 * payRate) + (hours ) * 1.5 *payRate otherwise, wages = hours * payRate Weekly Wages, in General