EKT150 Introduction to Computer Programming. Wk1-Introduction to Computer and Computer Program



Similar documents
Welcome to Introduction to Computers and Programming Course using Python

Chapter 13: Program Development and Programming Languages

3 SOFTWARE AND PROGRAMMING LANGUAGES

Chapter 12 Programming Concepts and Languages

Algorithm & Flowchart & Pseudo code. Staff Incharge: S.Sasirekha

Objectives. Python Programming: An Introduction to Computer Science. Lab 01. What we ll learn in this class

Python Programming: An Introduction to Computer Science

Flowchart Techniques

Chapter 13: Program Development and Programming Languages

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

McGraw-Hill The McGraw-Hill Companies, Inc.,

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Python Programming: An Introduction to Computer Science

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

How To Understand Programming Languages And Programming Languages

EMC Publishing. Ontario Curriculum Computer and Information Science Grade 11

Fundamentals of Programming and Software Development Lesson Objectives

Instructor Özgür ZEYDAN BEU Dept. of Enve. Eng. CIV 112 Computer Programming Lecture Notes (1)

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Computer Programming I & II*

Software: Systems and. Application Software. Software and Hardware. Types of Software. Software can represent 75% or more of the total cost of an IS.

ATSBA: Advanced Technologies Supporting Business Areas. Programming with Java. 1 Overview and Introduction

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Software: Systems and Application Software

Problem Solving Basics and Computer Programming

Computer Layers. Hardware BOOT. Operating System. Applications

Chapter 14. Programming and Languages. McGraw-Hill/Irwin. Copyright 2008 by The McGraw-Hill Companies, Inc. All rights reserved.

CHAPTER 1 ENGINEERING PROBLEM SOLVING. Copyright 2013 Pearson Education, Inc.

Notes on Algorithms, Pseudocode, and Flowcharts

18 Software. design. Learning outcomes. Credit value: 10

Basics of Computer 1.1 INTRODUCTION 1.2 OBJECTIVES

TYPES OF COMPUTERS AND THEIR PARTS MULTIPLE CHOICE QUESTIONS

River Dell Regional School District. Computer Programming with Python Curriculum

THREE YEAR DEGREE (HONS.) COURSE BACHELOR OF COMPUTER APPLICATION (BCA) First Year Paper I Computer Fundamentals

Flowcharting, pseudocoding, and process design

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

Lesson 06: Basics of Software Development (W02D2

Chapter 1 An Introduction to Computers and Problem Solving

Licensed to: CengageBrain User

Introducción. Diseño de sistemas digitales.1

Course Objectives Course Requirements Methods of Grading S/N Type of Grading Score (%) Course Delivery Strategies Practical Schedule LECTURE CONTENT

Introduction to Computers and Programming

Ch. 10 Software Development. (Computer Programming)

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

CS 40 Computing for the Web

Chapter 1. The largest computers, used mainly for research, are called a. microcomputers. b. maxicomputers. c. supercomputers. d. mainframe computers.

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Software. Programming Language. Software. Instructor Özgür ZEYDAN. Bülent Ecevit University Department of Environmental Engineering

2) What is the structure of an organization? Explain how IT support at different organizational levels.

Software development and programming. Software

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

Programming Languages & Tools

Introduction to programming

Computer Programming

1 PERSONAL COMPUTERS

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

Obj: Sec 1.0, to describe the relationship between hardware and software HW: Read p.2 9. Do Now: Name 3 parts of the computer.

Describe the process of parallelization as it relates to problem solving.

Computer Organization

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

Software Development. Topic 1 The Software Development Process

Stage 5 Information and Software Technology

Sources: On the Web: Slides will be available on:

The Application of Visual Basic Computer Programming Language to Simulate Numerical Iterations

Files. Files. Files. Files. Files. File Organisation. What s it all about? What s in a file?

ALGORITHMS AND FLOWCHARTS. By Miss Reham Tufail

#820 Computer Programming 1A

Chapter 3. Operating Systems

Practical Programming, 2nd Edition

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

1.1 Electronic Computers Then and Now

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

CONTROL DATA" 3200 Computer system / ~eal Time Applications

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

ERA6 OBJECTIVE QUSESTION

CS 51 Intro to CS. Art Lee. September 2, 2014

Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language

Algorithms, Flowcharts & Program Design. ComPro

WHITE PAPER. Peter Drucker. intentsoft.com 2014, Intentional Software Corporation

Microsoft Access is an outstanding environment for both database users and professional. Introduction to Microsoft Access and Programming SESSION

Overview of Programming and Problem Solving

Hypercosm. Studio.

Chapter 2: Algorithm Discovery and Design. Invitation to Computer Science, C++ Version, Third Edition

1 File Processing Systems

The Subnet Training Guide

Basic Computer Hardware and Software

Appendix M INFORMATION TECHNOLOGY (IT) YOUTH APPRENTICESHIP

RARITAN VALLEY COMMUNITY COLLEGE COURSE OUTLINE. CISY 103 Computer Concepts and Programming

Basic Concepts of Information Technology (IT)

Embedded Software development Process and Tools: Lesson-3 Host and Target Machines

2 SYSTEM DESCRIPTION TECHNIQUES

Program Your Own Game

Algorithm and Flowchart Structured Programming 1

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

lesson 1 An Overview of the Computer System

S7 for Windows S7-300/400

Transcription:

EKT150 Introduction to Computer Programming Wk1-Introduction to Computer and Computer Program

A Brief Look At Computer Computer is a device that receives input, stores and processes data, and provides output in a useful format. Computers process data according to sets of instructions called computer programs Example: laptops, PCs, mainframes, even everyday objects such as mobile phones, washing-machines, TV sets, cars contain computers Hardware Physical components of a computer Example: Keyboard, screen, mouse, disks, memory, CD-ROM, and processing units Software Programs that run on a computer Example: Operating System such as windows XP -Vista -7, Word processing packages such as MS Word, registration program

Computer Hardware

Exercise : Distinguishing between input-process-output-storage The scenario: At the end of each month, a clerk enters the employee name, number of days present and absent, and the number of overtime done in the system. The system then calculates the normal salary, the amount for overtime and the total salary. The clerk then saves the information in the computer hard disk, and takes a backup on a cd. A report is produced for the clerk so that the latter can show to the manager. Task: Identify the following for that particular system Input: the employee name, number of days present and absent, the number of overtime Process(es): calculate normal income, calculate amount for overtime, calculate total salary Output: Report Storage: Harddisk, CD-ROM

How Computer Processes Information Computers are NOT intelligent Computers do what we tell them to do they don t do anything by themselves. We must clearly tell a computer what to do in a step by step manner using a programming language. Computers only understand electronic High voltage/low voltage The machine language Machine language is binary (two values: high/low) 1 s and 0 s

Why we use computer Computers produce fast, accurate and reliable results. While computers do the boring, repetitive, ordinary tasks, we can spend our efforts and time to work on more interesting and creative tasks. The use of computers in business and manufacturing decreases the cost of goods and services produced. It is more difficult and needs more time to find or grow up a skill-full labour in IT industry, while buying an additional computer and installing the required software on is easier and cheaper.

Programming / Program / Programmer Programming in general term is planning or implementation of a task or event command. In the computing field, is instructing a computer to perform specific tasks. Computer programming can be defined as the process of planning a set of sequence commands to be executed by a computer. Program be defined as a set of sequence commands that have been determined to be executed by a computer. Computers are just electronic devices that have the power to perform difficult tasks but they do not KNOW what to do therefore - programmers tell the computers what to do by writing programs

Types of Programming Machine language languages Strings of numbers giving machine specific instructions Example: +1300042774, +1400593419, +1200274027 Assembly language English-like abbreviations representing elementary computer operations (translated via assemblers) Example: LOAD BASEPAY ADD OVERPAY STORE GROSSPAY High level language Codes similar to everyday English. Use mathematical notations (translated via compilers) Example Code: grosspay = basepay + overtimepay Example high level languages: C, C++, Cobol, Java, Pascal (Delphi), Basic (Visual Basic) Fortran, SQL, T- SQL, C#

Programming Problem Problem that can be solve using programming language. Suppose you want to add 34 and 56, this is easy. But to add 100 numbers is difficult for us need to use calculator or paper and pencil. Or we can write a program for computer to help us. Can these problems solve by computer programming? Converting units from kilograms to grams. Counting the number of cars on a highway. Finding a life partner Total rain in a week How long we live What we want to eat for dinner

Use of programs to solve problems

Data, Information and Knowledge Data are the raw facts, gathered from the environment which does not have much meaning. Note: Data is plural, singular form is Datum. Information is the end product of the processing of data, which has more meaning, and is used in decision making. Knowledge is the proved and generalized form of information, that is used in strategic planning.

Properties of Well Designed Programs Well designed programs must be: Correct and accurate Easy to understand Easy to maintain and update Efficient - Reliable can be rely on Flexible easily adapt in other situation / problem Correct and accurate Easy to understa nd Easy to maintain and update Efficient Reliable Flexible

Steps involve in programming (Planning) Requirement Specification: Eliminate ambiguities, Clearly understand the problem Analyze the problem: Understand the inputs, outputs and processes used for manipulating the data, formulas and constraints Design: Write the algorithm (flowchart or pseudocode) to represent the solution Testing and verification: Check the algorithm. Implement the algorithm: Write a program Testing and Verification: Check the program Documentation

Algorithm An algorithm is the plan for writing a program. Steps required for solving a problem are listed by using an algorithm tool. Algorithm tools make program solutions more clear, more understandable, and easier to remember. Algorithms are written according to rules so that other programmers are also able to read and understand the solution easily.

Tools of Algorithm There are many Algorithm tools in use, but the most popular ones are Pseudo-Codes and Flowcharts. In this course for all problems we will use both of these tools but in general you choose only one.

Example flowchart / pseudo-code Pseudocode 1. Insert key 2. Free the gear 3. Turn on to starting position 4. IF (engine starts in 6 sec) 4.1 YES go to step 5 4.2 NO IF (> 5 times) 4.2.1 YES call workshop go to step 5 4.2.2 NO go to step 3 5. Release the key 6. End

Structured Programming All programs can be written using three control structures Sequence One statement is executed after another Selection A statement is executed or skipped depending on whether a condition evaluates to TRUE or FALSE. Example: if, switch Repetition Statements are executed repeatedly until a condition evaluates to TRUE or FALSE. Example: while, for

Flowchart Flowcharts are graphical tools, containing a set of shapes, each expressing a different action in a sequence of program execution. There are many different shapes that are used for specific purposes, to avoid complexity, in this course, only a limited subset of these shapes will be shown and used in applications.

Flowchart Shapes Terminal Input Display Process Decision Connector Predefined Process Indicates the starting or ending of the program Used for data entry from keyboard. Use display on screen Indicates any type of internal operation inside the Processor or Memory (STORE INFORMATION & DO CALCULATIONS -variables) Used to ask a question that can be answered in a binary format (Yes/No, True/False) Allows the flowchart to be drawn without intersecting lines or without a reverse flow. Used to invoke a subroutine or an interrupt program.

Flowchart: Sequence/Selection/Repetition

Example: Using Connectors

Pseudo-code Pseudo-code is structured english that is used as an alternative method to flowcharts for planning structured programs. There are no general accepted standards for pseudocodes. We will work with a form that has minimum number of rules and is essentially language-independent. Pseudo-code instructions are written in English, they can be easily understood and reviewed by users. The only syntax rules to be concerned with involve the LOOP and SELECTION structures. They must be used as CAPITALISED words.

Pseudo-Code Constructs Assignment: Set num1 to 1 Num1 =1 Computation Input You can use either one of these assignment statements. We prefer the second one Use all arithmetic operators: addition (+), subtraction (-). Division (/), multiplication (*), modulus (%) Input : to enter from the keyboard Read : to read from a file Output Display : to display on screen Print : to print on the printer Selection IF.. END IF IF.. ELSE END IF IF.. ELSE IF.. ELSE END IF SWITCH.. CASE Repetition Repeat... Until (condition) While (condition) Begin : End For (condition) Begin : End

Example 1 Write an algorithm that will ask user to input a number then your design will calculate and display the square of input number:

Example 2 Write an algorithm that will ask user to input 10 students' marks and calculate the average students' mark and display all ten marks and the average students' mark:

Exercise Write an algorithm that will ask user to input height in meters then your design will convert and display the cm value of input number Write an algorithm to input a student's mark and determine the student's grade. Use table below to determine the grade B Grade >=90 A 80-89 B 70-79 C 60-69 D < 60 E

References Yuksel Uckan, Problem Solving Using C,Structured Programming Techniques, McGraw-Hill Deitel and Deitel, C: How to Program, McGraw-Hill Cheng, H., C for Engineers and Scientists, McGraw Hill, 2010. Hanly, J.R. and Koffman, E.B., C Program Design for Engineers, 2 nd Ed., Addison-Wesley, 2001. ISBN : 0321204174