Pseudocode is an abbreviated version of the actual statement t t (or code ) in the program.

Similar documents
Chapter 2 Working with Data Types and Operators

Differentiate Between Keywords and Identifiers

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

Lecture 2 FORTRAN Basics. Lubna Ahmed

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Programming in QBasic

Introduction to TURING

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

Full file at C How to Program, 6/e Multiple Choice Test Bank

Microsoft Visual Basic 2015: Reloaded

Lecture 2 Tao Wang 1

How to Do Word Problems. Study of Integers

REVIEW. The C++ Programming Language. CS 151 Review #2

Full file at

Language Fundamentals

Fundamentals of C Programming

Datatypes, Variables, and Operations

Ex: If you use a program to record sales, you will want to remember data:

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Chapter 2, Part III Arithmetic Operators and Decision Making

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

BASIC ELEMENTS OF A COMPUTER PROGRAM

LECTURE 02 INTRODUCTION TO C++

COMP Primitive and Class Types. Yi Hong May 14, 2015

CIS 3260 Intro to Programming with C#

Programming Language 2 (PL2)

FRAC: Language Reference Manual

Using Custom Number Formats

Introduction to Programming in Turing. Input, Output, and Variables

Data Types and the while Statement

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

The Rational Number System: Investigate Rational Numbers: Play Answer Sheet

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

Java Programming Fundamentals. Visit for more.

IT 374 C# and Applications/ IT695 C# Data Structures

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

Test Bank for An Object Oriented Approach to Programming Logic and Design 4th Edition by Joyce Farrell

BEGINNING PROBLEM-SOLVING CONCEPTS FOR THE COMPUTER. Chapter 2

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Introduction to FORTRAN

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

Variables and Values

Programming and Data Structures

Professor: Sana Odeh Lecture 3 Python 3.1 Variables, Primitive Data Types & arithmetic operators

Fundamentals of Programming CS-110. Lecture 2

The C++ Language. Arizona State University 1

COMPUTER SCIENCE SECTION A

Understanding Regular Expressions, Special Characters, and Patterns

Outline. Data and Operations. Data Types. Integral Types

CS-201 Introduction to Programming with Java

Chapter 2 Basic Elements of C++

Retrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved.

Introduction to Engineering gii

Chapter-8 DATA TYPES. Introduction. Variable:

Visual C# Instructor s Manual Table of Contents

Our Strategy for Learning Fortran 90

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.

ANSI C Programming Simple Programs

Unit 2: Accentuate the Negative Name:

1. What type of error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d.

Type of Cobol Entries

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Arithmetic Operations

2.0 MATLAB Fundamentals

Programming for Engineers Introduction to C

Lecture 3 Tao Wang 1

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

Table of Contents. Introduction to the Math Practice Series...iv Common Mathematics Symbols and Terms...1


Grade 4 ISTEP+ T1 #1-2 ISTEP+ T1 # Identify, describe and draw parallelograms, rhombuses, and ISTEP+ T1 #5-6

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

CGF Lecture 2 Numbers

ENGR 101 Engineering Design Workshop

These are reserved words of the C language. For example int, float, if, else, for, while etc.

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

Petros: A Multi-purpose Text File Manipulation Language

Excel Lesson 3 USING FORMULAS & FUNCTIONS

An Introduction to Processing

Chapter 2: Using Data

Chapter 17. Fundamental Concepts Expressed in JavaScript

GeoCode Language Reference Manual

Fundamental of Programming (C)

Program Fundamentals

Basics of Java Programming

Using Basic Formulas 4

Objectives. Data Types (continued) Data Types 4. การเข ยนโปรแกรมพ นฐาน ว ทยาการคอมพ วเตอร เบ องต น Fundamentals of Computer Science

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Spreadsheet EXCEL. Popular Programs. Applications. Microsoft Excel. What is a Spreadsheet composed of?

Basics of Programming

Working with Formulas and Functions


\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Chapter 4: Computer Codes. In this chapter you will learn about:

Fundamentals of Programming

JAVA Programming Fundamentals

LESSON 5 FUNDAMENTAL DATA TYPES. char short int long unsigned char unsigned short unsigned unsigned long

CHIL CSS HTML Integrated Language

Transcription:

Pseudocode Pseudocode is an abbreviated version of the actual statement t t (or code ) in the program. It is a type of algorithm in that all steps needed to solve the problem must be listed. 1 While algorithms are written to solve all type of problems, Pseudocode d is used specifically for programming problems

Example 1 A pseudocode to compute the area of a ti triangle, given its Length and dbreath 1. INPUT length as L 2. INPUT Breath as B 3. Area = L * B 4. PRINT Area 5. Stop 2

Example 2

Introduction to QBASIC Lecture 5

Constants Constants are values that do not change during the execution of a program. There are generally two types: 1. Numeric constants 2. Character string constants

Categories of constants

Numeric constants A number included in a statement is called a numeric constant. t It can be decimal or an integer Exponential notation is used when very large or small numbers are involved A numeric constant t is any real or integer that t can be assign to a numeric variable.

Example Type Examples Integer 236 45312-236 +145-61231 Decimal/Real 236. -156.76 +7015-8878 0.215 Exponential 2.61E 4 0.156E-4 2E10 +2.456E-08

Remarks A numeric constant should not contain any character except the digit it 0 9 and a decimal Commas (,) are not allowed in numbers e.g., 1,234.25 X 1234.2525 If a number has no sign, the computer assumes it is positive. E.g., 237 =+237

Remarks cont If a number is negative, the negative sign must precede the digit, it as in -210 Fractions must be written in decimal form. E.g., 3.75 is the correct representation ti for No blank spaces are allowed e.g., 1 364 3 3 4

Character String Constant A character string constant is a collection of symbols called alphanumeric data. It can include any combination of letters, numbers and special characters including dashes, commas, blanks, etc It t b l d i d bl t ti It must be enclosed in double quotation marks

Character String Constant cont Single quotation marks can be used within a string contained within double quotation ti marks E.g., She said, what did you do? It is invalid to have for e.g., The letter E is a vowel Note that the computer can store a blank E.g., University, University

Variables A variable is a storage location containing a value that t can change during program execution A variable can contain only one value at a time Use descriptive variable names to identify values E.g., QuantityOnHand is better than QUAN

Remarks The first character of the variable name must be a letter. The remaining i characters may be letters, numbers and period QBASIC does not differentiate t between uppercase and lowercase letters in variable names. FirstName FIRSTNAME Firstname are all identical

Types of Variables There are two types: 1. Numeric variables 2. String variables

Numeric variables Numeric variables are used to store numbers that t are either supplied to the computer by the programmer /user or internally calculated during program execution. It must begin with a letter, followed by letters, digits and periods E.g., BigNumber, TOTAL.PRICE, CLASS2A Some invalid variable names are : 1. Maximum/Average 2. 1stChoice 3. Square meters

String Variables A string variable is used to store a character string ti such as a name, an address or a social security number. A string variable name must begin with a letter followed by letter or digit and must be terminated with a dollar sign ($). E.g., Headings$ Employee$ DaysOfWeek$

Remark Certain words have specific meanings to QBASIC. They are called reserved words/ keywords and thus cannot be used as variable names. Examples: READ, LET, END, LIST etc.

BASIC characters Refer to Laboratory manual

Arithmetic Operations and Expressions In QBASIC, arithmetic expressions are composed of numeric constants numeric variables arithmetic operators

Arithmetic operators The most commonly used arithmetic operators are as follows: Operator Operation BASIC Expression + Addition A + B - Subtraction A - B / Division A/B * Multiplication A * B ^ Exponentiation A^B

Expressions Expressions can be: Arithmetic Logical An Arithmetic ti expressions is an arithmetic ti formula consisting of a sequence of variables, constants and arithmetic operators that is to be evaluated. E.g., X + 9 A + B + C 7 0.5 * A* H

Expressions cont A logical expression is a sequence of variables, constants, t relational l operators and connectives that always has a value of either true or false. E.g., A > B X + Y <= 0 A < B AND B < C

Statements A statement is the fundamental unit in a computer program.