SNS COLLEGE OF ENGINEERING,

Similar documents
SNS COLLEGE OF ENGINEERING

Flowchart & Algorithm

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

A Quick Review of Chapter 1

Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING

Logic & Algorithms Foundations of Computer Science Behrouz A. Forouzan, Brooks/Cole Thomson Learning, Pacific Grove, USA, 2003.

8 Algorithms 8.1. Foundations of Computer Science Cengage Learning

Unit 1: Algorithmic problem solving 1

Chapter 8 Algorithms 1

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

Algorithms. Chapter 8. Objectives After studying this chapter, students should be able to:

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

PROBLEM SOLVING AND PYTHON PROGRAMMING

UNIT-3 PROBLEM SOLVING AND OFFICE AUTOMATION

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

Unit II. (i) Computer Programming Languages

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha

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

Computer System and programming in C

Algorithm. Building blocks of algorithm

Introduction. C provides two styles of flow control:

Algorithms and Flowcharts

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

Algorithms. Abdelghani Bellaachia, CSCI 1121 Page: 1

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

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

Algorithms (continued)

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

Steps to program development

FLOW CHART AND PSEUDO CODE

3. You are writing code for a business application by using C#. You write the following statement to declare an array:

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

Chapter 2 - Problem Solving

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

PSEUDOCODE AND FLOWCHARTS. Introduction to Programming

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

UNIT I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

Chapter 3 Structured Program Development

Assignment: 1. (Unit-1 Flowchart and Algorithm)

Algorithm Discovery and Design

Pseudo Code and Flow Charts. Chapter 1 Lesson 2

Programming Logic & Pseudocode. Python Bootcamp, Day 1 Anna Rosen

Python - Week 1. Mohammad Shokoohi-Yekta


4. The is a diagram that graphically depicts the steps that take place in a program. a. Program b. Flowchart c. Algorithm d. Code e.

Method & Tools for Program Analysis & Design

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

SME1013 PROGRAMMING FOR ENGINEERS

Algorithm Discovery and Design. Why are Algorithms Important? Representing Algorithms. Chapter 2 Topics: What language to use?

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

Chapter 5 Conditional and Iterative Statements. Statement are the instructions given to the computer to perform any kind of action.

REPRESENTING ALGORITHMS. REPRESENTING ALGORITHMS IB DP Computer science Standard Level ICS3U

Instructor: SIR MUHAMMAD NAVEED Created by: ARSLAN AHMED SHAAD ( ) MUHAMMAD BILAL ( ) ISIT:

Engineering program development. Edited by Péter Vass

9/23/2013. Chapter 2. Objectives. Introduction. Objectives (continued) Representing Algorithms. Representing Algorithms

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

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

Chapter 1 - An Introduction to Computers and Problem Solving

Program Elements -- Introduction

CSC 121 Spring 2017 Howard Rosenthal

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS

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

Code No: R Set No. 1

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

Chapter Two: Program Design Process and Logic

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

DEPARTMENT OF MATHS, MJ COLLEGE

Flow Chart. The diagrammatic representation shows a solution to a given problem.

Control Statements. Objectives. ELEC 206 Prof. Siripong Potisuk

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

CS 199 Computer Programming. Spring 2018 Lecture 2 Problem Solving

1. What is the minimum number of bits needed to store a single piece of data representing: a. An integer between 0 and 100?

Structured Program Development in C

Questions Bank. 14) State any four advantages of using flow-chart

Pseudocode Structure 5th October 2018

GE PROBLEM SOVING AND PYTHON PROGRAMMING. Question Bank UNIT 1 - ALGORITHMIC PROBLEM SOLVING

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

1. Introduction to Programming

Introduction to C Programming

Algorithms, Part 2 of 3. Problem Solving. Problem Solving (con t) Topics Problem Solving Examples Pseudocode Control Structures

ALGORITHMS AND FLOWCHARTS

Perl Basics. Structure, Style, and Documentation

Control Structures II. Repetition (Loops)

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

COMP 202 Recursion. CONTENTS: Recursion. COMP Recursion 1

Computer Programming : C++

CS111: PROGRAMMING LANGUAGE1. Lecture 2: Algorithmic Problem Solving

Chapter 2. The Algorithmic Foundations of. Computer Science INVITATION TO. Computer Science. Tuesday, September 10, 13

COMPUTING Syllabus Version 1.0

Theory of control structures

Computers and FORTRAN Language Fortran 95/2003. Dr. Isaac Gang Tuesday March 1, 2011 Lecture 3 notes. Topics:

UNIT 1-2 MARKS QUESTIONS WITH ANSWERS

Welcome to Starting Out with Programming Logic and Design, Third Edition.

Question Bank (SPA SEM II)

Class 8 ALGORITHMS AND FLOWCHARTS. The City School

Loops / Repetition Statements

S/W Programming & Languages

An Introduction to Python (TEJ3M & TEJ4M)

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

Transcription:

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 are electronic devices that can follow instructions to a. accept input, b. process the input c. then produce information. 2. List the basic functions of computer. Input Processing Output Storing Controlling 3. Mention the applications of computer. Business Industry Home Education Entertainment Printing and Publishing

4. List the characteristics of computer. 5. Mention the generations of computer. 6. Mention the types of computer

7. What is program? Program is a collection of instructions that will perform some task. 8. List the problem solving steps. 1) Specify problem requirements 2) Analyze the problem 3) Design an algorithm to solve the problem 4) Implement the algorithm 5) Test and verify the completed program. 6) Maintain and update the program. 9. What is algorithm? Algorithm is a sequence of instructions written in the form of English phrases required for producing the desired result It involves identifying variable names and types that would be solving the problem Step by Step Procedures 10. List the qualities of good algorithm. An algorithm is considered as good,if It uses most efficient logic(time complexity) It uses minimal system memory for its execution - memory It should able to generate most accurate results accuracy Sequence 11. What are the building blocks or control structure of algorithm? Sequence structure - Action Selection structure - Decision Iteration structure - Repetition or Loop 12. What is sequence structure? The execution of the statements is done sequentially. More than one instruction to be followed in order. It uses top-down approach. Example: Addition of two numbers Step1: Start Step2: Read a, b Step3: Add the value of a with b and store the result in sum.

Step4: Display the value of sum Step5: Stop 13. What is selection structure? Two sets of statement blocks are written in a program along with one or more conditions The execution occurs if the condition is true, if the condition is false else part is executed It is used for making decisions Example: To find the greatest among two numbers Step1: Start Step2: Read the value of a, b, c Step3: IF (a>b) and (a>c) THEN print a is largest ELSE IF (b>c) THEN print b is largest ELSE print c is largest Step4: Stop 14. Mention the advantages and disadvantages of algorithm? Advantages: It is a step-wise representation, which makes it easy to understand. It is easy to understand for anyone even without programming knowledge. Every step in an algorithm has its own logical sequence so it is easy to debug. By using algorithm, the problem is broken down into smaller pieces or steps hence, it is easier for programmer to convert it into an actual program Disadvantages of algorithm Writing algorithm takes a long time. An Algorithm is not a computer program, it is rather a concept of how a program should be 15. List the properties of algorithm? Should be written in simple English Should be unambiguous, precise and easy understanding Should provide the correct solutions Should have an end point The output statements should follow input, process instructions

The initial statements should be of input statements Should have finite number of steps Every statement should be definitive 16. What is sequence structure? The execution of this structure is repeated many times if the conditional statement is true. Example: To find factorial of the number: Step1: Start Step2: Read the value of n and set i =1 Step3: while i <= n do fact =fact * i i = i + 1 else Goto step5 Step4: Go to step 3 Step5: print the value of fact Step6: Stop 17. What is pseudocode? It consists of Short, Readable and formally styled English language It is used for explaining the algorithm It does not include variable declaration 18. What is the purpose of pseudocode? Detailed algorithm before developing a program is very time consuming It focuses on only logic of program It is not written using specific syntax Written by using combination of Generic syntax and normal English language 19. Mention the rules for writing pseudocode. Write only one statement per line Capitalize initial keyword Indent to show hierarchy End Multiline structures Keep statements language independent

20. List the terms used while writing the pseudocode. Input data INPUT, GET, READ Calculation COMPUTE, CALCULATE Output OUTPUT, PRINT, DISPLAY Incrementing INCREMENT Addition, Subtraction, Initialization ADD, SUBTRACT, INITIALIZE 21. Draw the control structures diagram. 22. Mention the advantages of Flow chart. Standardized Visual 23. List the advantages of pseudocode. a. Easily modified b. Implements structured concepts c. Done easily on Word Processor d. Works well for large program 24. List the disadvantages/limitations of flowchart a. Hard to modify

b. Structured design elements not implemented c. Special software required d. It is difficult to use flowcharts for large programs. 25. Mention the disadvantages of pseudocode. a. Not visual b. No accepted standard, varies from company to company 26. Mention the rules for defining a variable. Begin with lowercase letter Contain no spaces Additional words begin with capital Unique names within code Consistent use of names 27. Difference between iteration and recursion. S.No Iteration Recursion 1 Code may be longer Code may be smaller 2 It is faster than recursion It is slower than iteration 3 Consumes less memory compared to Uses more memory than iteration recursive approach 4 Uses for and while loop Uses selection structure 28. What is recursion? Function which calls itself is called recursive function. The process is called recursion. 29. Mention the benefits of flowchart. 1) Makes Logic Clear. 2) Communication 3) Effective Analysis 4) Useful in Coding 5) Useful in testing 30. Write the rules for drawing flowchart. 1) Standard symbols should be used. 2) Only one flow lines should come out from a process symbol.

3) Intersection of flow lines should be avoided 4) Only one flow line should enter a decision symbol, but two or three lines can leave the decision symbol. 31. What are the building blocks of algorithm? Building blocks Common Name Sequence Structure Action Selection Structure Decision Iteration Structure Repetition or Loop 32. Mention the characteristics of algorithm. Steps in algorithm must be simple and must not be ambiguous. It should be written in sequence Ensure that algorithm will terminate It must solve the given problem. 33. Define flowchart. It is a pictorial representation of an algorithm. It represents flow of control and logic in the solution to the problem It uses different symbols for describing activities Flow Lines Start/Stop Calculation Input/Print Decision Connector