Unit II. (i) Computer Programming Languages

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

PROBLEM SOLVING AND PYTHON PROGRAMMING

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

S/W Programming & Languages

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

Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING

FLOW CHART AND PSEUDO CODE

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

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

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

Unit 1: Algorithmic problem solving 1

Chapter Twelve. Systems Design and Development

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

SNS COLLEGE OF ENGINEERING,

Visual Basic Course Pack

Copyright 2005 Department of Computer & Information Science

SME1013 PROGRAMMING FOR ENGINEERS

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

Programming Languages and Program Development Life Cycle Fall Introduction to Information and Communication Technologies CSD 102

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

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

ENT 189: COMPUTER PROGRAMMING. H/P: Home page:

Simply Java Programming: An Application Driven, Tutorial

Introduction to Computers

SNS COLLEGE OF ENGINEERING

Programming Logic and Design Seventh Edition Chapter 2 Elements of High-Quality Programs

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

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

PROGRAM DESIGN TOOLS. Algorithms, Flow Charts, Pseudo codes and Decision Tables. Designed by Parul Khurana, LIECA.

UNIT-3 PROBLEM SOLVING AND OFFICE AUTOMATION

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS

1. Introduction to Programming

Introduction to Programming. January Examination Paper. Time: 3 hours

Algorithm: 1. Introduction

Chapter 1: An Overview of Computers and Logic

Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

Problem solving 1. Chapter 1 PROBLEM SOLVING

Chapter Two: Program Design Process and Logic

Computer Programming-I. Developed by: Strawberry

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

Introduction Objectives: 1) differentiate between high-level, low-level, and machine language; 2) explain why it is necessary to translate a program


SME 1013 Programming for Engineers

A Beginner s Guide to Programming Logic, Introductory. Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs

The following notation will be used in the explanations:

Chapter 3: Modules. Starting Out with Programming Logic & Design. Second Edition. by Tony Gaddis

Basics of Spreadsheet

CS187 - Science Gateway Seminar for CS and Math

Computer System and programming in C

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

The births of the generations are as follow. First generation, 1945 machine language Second generation, mid 1950s assembly language.

Steps to program development

Computing Seminar Introduction Oct

Unit 1: Introduction to Algorithms

Method & Tools for Program Analysis & Design

I101/B100 Problem Solving with Computers

EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA

3.2 Graphs of Linear Equations

Programming Languages and Program Development

Revision Topic 11: Straight Line Graphs

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANGULATHUR

The Further Mathematics Support Programme

Introducing Computer Programming

CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar

INDEX. Sl. No. Programs Page No. Procedure 2. 1 To check whether person is eligible for vote or not. 2 To find the given number is even or odd 6-8

Control Statements: Part 1

Introduction to Computer Programming Using FORTRAN 77

Scheme of work Cambridge International AS & A Level Computing (9691)

CP FAQS Q-1) Define flowchart and explain Various symbols of flowchart Q-2) Explain basic structure of c language Documentation section :

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Programming II (CS300)

Final Examination Semester 3 / Year 2010

Introduction to Computers and Java

Algorithms and Flowcharts

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

ITEC102 INFORMATION TECHNOLOGIES

Carnegie Learning Math Series Course 2, A Florida Standards Program

DIOCESE OF HARRISBURG MATHEMATICS CURRICULUM GRADE 5

Describe the layers of a computer system

Module 1: Introduction to Computers, Programs, and Java

Programming Practice (vs Principles)

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

State two analytical tools used to understand feasibility of a proposed application. Acceptable answer(s) Guidance Max mks

Day 5: Inscribing and Circumscribing Getting Closer to π: Inscribing and Circumscribing Polygons - Archimedes Method. Goals:

A Quick Review of Chapter 1

GET130 Intro to Engineering Technology Fall 2013

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

Chapter 1 Getting Started Structured Programming 1

Basic and Intermediate Math Vocabulary Spring 2017 Semester

Chapter 6 Programming the LC-3

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

III. Check if the divisors add up to the number. Now we may consider each of these tasks separately, assuming the others will be taken care of

Assignment #2: Simple Java Programs Due: 1:15pm on Friday, April 19th

CIRCLES ON TAKS NAME CLASS PD DUE

Algorithms and Programming Languages

Stating the obvious, people and computers do not speak the same language.

HYBRID FORCE-DIRECTED AND SPACE-FILLING ALGORITHM FOR EULER DIAGRAM DRAWING. Maki Higashihara Takayuki Itoh Ochanomizu University

Introduction to Programming: Variables and Objects. HORT Lecture 7 Instructor: Kranthi Varala

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha

Transcription:

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 programming languages have been created with many more being created every year. Most programming languages describe computation in an imperative style, i.e., as a sequence of commands, although some languages, such as those that support functional programming or logic programming, use alternative forms of description. Computer Languages are generally classified into two categories (i) (ii) Low Level computer programming language and High Level computer programming language Low level languages can either be (i) Machine language or (ii) Assembly language. They have the following characteristics. They are machine dependent, They require the programmers to have a good knowledge of the internal structure of the computer being used They are very difficult to learn They are not portable to other machine with different instruction set They are very fast to execute They more prone to errors Examples of low level languages include machine language specific to each processor and assembly language specific to each processor. High level languages allow much more abstraction than low level languages. This allows algorithms and functions to be written without requiring detailed knowledge of the hardware used in the computing platform. In comparison to low-level programming languages, it may use natural language elements, be easier to use, or be from the specification of the program, making the process of developing a program simpler and more understandable with respect to a low-level language. The amount of abstraction provided defines how "high-level" a programming language is. Examples of high level languages include Basic, Pascal, C, C++, Java, Visual Basic, etc.

Unit II. (ii) Steps in Programming A program is a set of instructions that performs a desired task. Different programs are written with different languages. An editing program is made with a different programming "language" than one that uses graphics. Some well known programming languages are COBOL -business, BASIC - language, and - C which is used in science. Programming is complicated process, below is general overview of 5 steps involved in Programming. 1. Clarify Programming Needs (Understanding the problem.) 2. Design the Program 3. Code the Program 4. Test the Program 5. Document and Maintenance 1. Clarify Programming Needs (Understanding the problem) Six mini steps are involved at this stage: Clarify objectives and users Clarify desired outputs Clarify desired inputs Clarify desired processing Double - check feasibility of implementing the program Document the analysis 2. Design the Program Two mini steps are involved at this stage: Determine program logic through top down approach and modularization, using a hierarchy chart. A hierarchy chart, which represents top-down program design, explains the main purpose of the program. Design details using Pseudocode and/or flowcharts, preferably involving control structure. Pseudocode, a way of designing a program which uses normal language statements in order to describe the logic and the processing flow. Program flowcharts, graphically shows the detailed series of steps Three control structure: Sequence control structure Conditional/Selection control structure Loop control structure 3. Code the Program Two mini steps are involved at this stage: Select the appropriate high-level programming language Code the program in that language following the syntax carefully

4. Test the Program Testing the program comes in two phases, alpha and beta. Alpha testing is the process of reading through the program in search of errors in logic. The second step is to run a diagnostic program to search for syntax or input errors. Beta testing involves using the program in the real world to see if it contains any bugs or other deficiencies. 5. Document and Maintenance Documentation should be ongoing from the very beginning because it is needed for those involved with program now and future. Upon completion User Documentation for commercial use, Operator Documentation for people who run computer systems, and Programmer Documentation for programmers charged with maintenance. Four mini steps are involved: Write user documentation Write operator documentation Write programmer documentation Maintain the program Unit II. (iii) Algorithms & Flow Charts What is an Algorithm: An Algorithm is a stepwise sequence of logical operations performed to get the solution of a problem. What is a FLOWCHART? A flowchart is a graphical representation of an Algorithm. Flowcharts are generally drawn in the early stages of formulating computer solutions. Flowcharts facilitate communication between programmers and business people. These flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. Flowcharts are usually drawn using some standard symbols; however, some special symbols can also be developed when required. Some standard symbols, which are frequently, required for flowcharting many computer programs are shown below.

Symbol OR Meaning Start or End of the flowchart Input or Output operation Processing or Computational steps Decision making and branching Flow of control Connector or joining of two parts of flow chart GUIDELINES FOR DRAWING A FLOWCHART Flowchart Symbols The following are some guidelines in flowcharting: a. In drawing a proper flowchart, all necessary requirements should be listed out in logical order. b. The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity in understanding the flowchart. c. The usual direction of the flow of a procedure or system is from left to right or top to bottom. d. Only one flow line should come out from a process symbol. e. Only one flow line should enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol. f. Only one flow line is used in conjunction with terminal symbol. g. Write within standard symbols briefly. As necessary, you can use the annotation symbol to describe data or computational steps more clearly.

h. If the flowchart becomes complex, it is better to use connector symbols to reduce the number of flow lines. Avoid the intersection of flow lines if you want to make it more effective and better way of communication. i. Ensure that the flowchart has a logical start and finish. j. It is useful to test the validity of the flowchart by passing through it with a simple test data. ADVANTAGES OF USING FLOWCHARTS The benefits of flowcharts are as follows: 1. Communication: Flowcharts are better way of communicating the logic of a system to all concerned. 2. Effective analysis: With the help of flowchart, problem can be analysed in more effective way. 3. Proper documentation: Program flowcharts serve as a good program documentation, which is needed for various purposes. 4. Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and program development phase. 5. Proper Debugging: The flowchart helps in debugging process. 6. Efficient Program Maintenance: The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put efforts more efficiently on that part LIMITATIONS OF USING FLOWCHARTS 1. Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clumsy. 2. Alterations and Modifications: If alterations are required the flowchart may require redrawing completely. 3. Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart becomes a problem. 4. The essentials of what is done can easily be lost in the technical details of how it is done. Assignment on Flowcharts 1. Draw a flowchart to (i) add 2 numbers (ii) multiply 2 numbers and (iii) subtract 2 numbers. 2. Draw a flowchart to calculate the area and circumference of a circle. (Area of circle = 3.14 * radius * radius, circumference = 2 * 3.14 * radius) 3. Draw a flowchart that converts the input Celsius degree into its equivalent Fahrenheit degree. Use the formula: F= (9/5) * C + 32 4. Draw a flowchart that converts the input Fahrenheit degree into its equivalent Celsius degree. Use the formula: C= (5/9)*F 32 5. Draw a flowchart to find the largest of three arbitrary numbers.

6. Draw a flowchart to generate the following series 1, 3, 5, 7, 9,., 97, 99 7. Draw a flowchart to generate the following series 2, 4, 6, 8, 10,.., 98, 100 8. Draw a flowchart to generate the table of an arbitrary number up to a given limit n. 9. Draw a flowchart to find the largest of n arbitrary numbers. 10. Draw a flowchart to find the sum of n arbitrary numbers.