Fundamental of Programming(101) Why study Programming Language Concepts? Increased capacity to express programming concepts Improved background for choosing.

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Lecture 1: Overview of Computers & Programming
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 1 - An Introduction to Computers and Problem Solving
COSC 120 Computer Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
An Overview of Computers and Logic
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
Programming Logic and Design Fourth Edition, Introductory
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Computers & Logic An Overview. Hardware Hardware is the equipment, or the devices, associated with a computer. For a computer to be useful, however, it.
Introduction to Computers and Programming
CS102 Introduction to Computer Programming
Programming Logic and Design Fifth Edition, Comprehensive
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
An Overview of Computers and Logic
INTRODUCTION TO COMPUTING
CIS Computer Programming Logic
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Introduction Lecture 01.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
An Object-Oriented Approach to Programming Logic and Design Chapter 1 An Overview of Computers and Logic.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Structured Programming (4 Credits)
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Introduction To Computers
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Introduction to Computer Programming using Fortran 77.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
INTRODUCTION TO PROGRAMING System Development Mansoura October 2015.
Operating Systems A Biswas, Dept. of Information Technology.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
CHAPTER 1 OVERVIEW OF COMPUTER AND PROGRAMMING 1.1 Electronic Computer Then and Now 1.2 Computer Hardware 1.3 Computer Software 1.4 The Software Development.
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Chapter 1: Introduction to Computers and Programming
Chapter 1 Introduction 2nd Semester H
ICS 3UI - Introduction to Computer Science
Programming Languages
DDC 1023 – Programming Technique
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Chapter 1: Introduction to Computers and Programming
ICT Gaming Lesson 2.
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Fundamental of Programming(101)

Why study Programming Language Concepts? Increased capacity to express programming concepts Improved background for choosing appropriate languages Increased ability to learn new languages Understanding the significance of implementation Increased ability to design new languages Overall advancement of computing

Evaluation Scheme Evaluation Scheme The academic performance of student is based on Continuous Internal Assessment (CIA) and Semester End Examinations (SEE). parameters of CIA Unit Test Quiz Assignments Seminar 2 Internal Test SEE INCLUDE 2 HOURS PRACTICAL AND 3 HOURS THOERY EXAM.

Reference Books: Text Books: 1. Farrell Joyce, Programming Logic and Design, Course Technology. 2. Behrouz Forouzan, Richard Giberg, Computer Science- A Structure Approach Using C, Cengage Learning Question Bank utu.ac.in

Unit-1 Introduction of Computers, Logic and Structure

1.1 Computer Components and Operations Programming Paradigm

Computer Components 1. Hardware Hardware is the equipment, or the devices, associated with Computer. for example Monitor, Keyboard, Mouse, Printer etc.

Computer Components 2. Software Computer Software are programs that tell the computer what to do given by the instructions. It is classify into two categories: 1.Systems Software : Includes the operating system and all the utilities that enable the computer to function. 2.Applications Software: Includes programs that do real work for users. For example, word processors, spreadsheets

Computer H/W & S/W accomplish four major operations: Input Processing Output Storage

Information Processing cycle--1 Processor Control Unit/Arithmetic Logic Unit Memory Storage Devices Input Devices Output Devices

Input Devices Any hardware component that allows you to enter data, programs, commands, and user responses into a computer Input Device Examples Keyboard Mouse

Output Devices Output devices make the information resulting from processing available for use Output Device Examples ◦ Printers  Impact  Nonimpact  Photo ◦ Display Devices  CRT  LCD

Storage Devices 1. Internal storage(Main Memory or Primary Memory) Use to store inside the machine. It is Volatile (contents are lost every time the computer loses power) 2.External Storage Use to store outside the machine. It is Non-Volatile Examples of external storage are: floppy-disk, hard disk or magnetic tape

Information Processing cycle--2 Processing Input Devices Output Devices Programming Languages Machine Languages Complier / Interpreter

source code for a program has been written by one or more humans in a programming language(or High level Language) (e.g., C or C++), it is compiled (i.e., converted) into machine code by a specialized program called a compiler, or by Interpreter. (converted language is known as machine language or low level language(o and 1 )This machine code is then stored as an executable file (i.e., a ready-to-run program) and can be executed (i.e., run) by the operating system.

1.2 Programming Process: Problem Understanding, Planning, Coding, Translation, Testing and Production

Programming process broken down into six steps: Understand the problem Plan the logic Code the program Translate the program Test the program Put the program into production

Understand the problem Analyze use needs and requirements Plan the logic Give the instructions to the computer in specific sequence this is called developing the logic Most common tools are: 1) Flowcharts 2) Pseudo code

Code the program To follow certain rules for giving instruction to machine is called syntax of the language Translate The program High-Level and low-level Language Test the program Logical and syntax errors Put the program into production if program is tested,the organization can use it by putting into production.

1.3 Data Hierarchy, Flowchart Symbols, Pseudo code Statements and Connector

Data Hierarchy File Record Field Character

Flowchart Symbols, Pseudo code Statements and Connector Flow Chart A flow chart is a pictorial representation of the logical steps to solve a problem. Pseudo code Pseudo code is a kind of structured English for describing algorithms. It allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.

Flowchart Symbols

Connector A connector will be used when limited page size forces to continue the flowchart on another page. Start Step -1 Step -2 1 Stop Step -3 Step -4 1

1.4 Variables, Data Types and Evolution of Programming Techniques

Variable A variable is a value that can change any time. It is a memory location used to store a data value. A variable name should be carefully chosen by the programmer so that its use is reflected in a useful way in the entire program. Example of variable names are: Sun number Salary Emp_name average1

Rules of Variables They must begin with a letter some system permit underscores as the first character. Length of variable should not be normally more than eight characters. Uppercase and lowercase are significant. That is the variable Total is not the same as total or TOTAL. The variable name should not be a keyword White space is not allowed.

Keywords and Identifies Keywords and Identifies Every C word is classified as either a Keyword or identifier. Keywords are the words whose meaning has already been explained to the C compiler. for example Auto, Break,Case,Char,Const,Continue,Default,Do,Double, Enum Identifiers refer to the names of variable, functions and arrays. These are user defined names and consist of a sequence of letter and digits

Data Type C support three types of data type 1.Primary ( int, char etc) 2.Derived (array, structure) 3.User defined (enum, type def)

Data Type Range BytesFormat Signed char-128 to % c Unsigned Char0 to 255 1% c Short signed int Signed int to % d Short unsigned int0 to % u Long signed int-2,14,74,83,648 to +2 14,74,83,647 4% ld Long unsigned int0 to 4,29,49,67,295 4% lu Float-3.4e38 to +3.4e38 4% f Double-1.7e308 to +1.7e308 8% lf Long double-1.7e4932 to +1.7e % Lf

1.5 Unstructured Spaghetti Code and Recognizing Structure

Unstructured / Spaghetti Code The popular name for unstructured program organization is spaghetti code. logic is free to jump from one place to anywhere else in the a program

1.6 Storae classes, basic structure & its reasons

The Sequence Structure A structure is a basic unit of programming logic; each structure is a sequence, selection, or loop.here with we can perform actions in order.

Selection Structure

Dual Branch Selection

A Repetition Structure programmers refer to looping as repetition or iteration

Stacking Structures

Nesting Structure Placing a structure within another structure is called nesting the structures

Priming Read

Understanding the Reasons for Structure Three structures(sequence, selection, and loop) is better for the following reasons: Clarity Professionalism Efficiency Maintenance

1.7 Special Structures

Case(selection)Structure Use the Case structure when there are several distinct possible values for a single variable being tested and each value requires different actions

Case(selection)Structure

The Do Until Loop

The Do While Loop