Chapter 3 – Fundamental Statements

Slides:



Advertisements
Similar presentations
VARIABLES AND DEBUGGING Beginning Programming. Assignment Statements  Used to hold values in a variable  Calculates a result and stores it in a variable.
Advertisements

P1PMF Split1 QBASIC. P1PMF Split2QBasic Command Prompt Will launch the emulator DOS operating system? Press Alt + Enter to display the widescreen.
1 C++ Syntax and Semantics The Development Process.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
Chapter 2: Input, Processing, and Output
An Introduction to Programming with C++ Fifth Edition Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.
Data types and variables
An Introduction to Programming with C++ Fifth Edition Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
Chapter 2 Data Types, Declarations, and Displays
Chapter 2: Introduction to C++.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
Basic Elements of C++ Chapter 2.
Input/Output  Input/Output operations are performed using input/output functions  Common input/output functions are provided as part of C’s standard.
CSC 125 Introduction to C++ Programming Chapter 2 Introduction to C++
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
Computer Programming TCP1224 Chapter 4 Variables, Constants, and Arithmetic Operators.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Chapter 2: Java Fundamentals
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Recognizing PL/SQL Lexical Units. 2 home back first prev next last What Will I Learn? List and define the different types of lexical units available in.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
1 homework Due today: hw #1 (mailing list printout) readings to date: chapter 1 and chapter read appendix B (3 pages on DOS) and and.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Constants, Variables and Data types in C The C character Set A character denotes any alphabet, digit or special symbol used to represent information.
Chapter 2 Input, Variables and Data Types. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords 
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 – Introduction to C# Programming Outline 3.1 Introduction 3.2 Simple Program: Printing a Line.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Constants, Data Types and Variables
Chapter 3 Using Variables, Constants, Formatting Mrs. UlshaferSept
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
Chapter Topics The Basics of a C++ Program Data Types
Chapter 2: Introduction to C++
Introduction to the C Language
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Basic Elements of C++.
Variables and Arithmetic Operations
Chapter 2: Introduction to C++
Basic Elements of C++ Chapter 2.
Variables and Arithmetic Operations
2.1 Parts of a C++ Program.
Chapter 3 The DATA DIVISION.
CHAPTER FOUR VARIABLES AND CONSTANTS
Chapter 2: Introduction to C++.
An Introduction to Programming with C++ Fifth Edition
Variables and Constants
Programming Fundamental-1
Chapter 2 Modular Programs with Calculations and Strings
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Chapter 3 – Fundamental Statements QBasic Chapter 3 – Fundamental Statements

QBasic Statement Components Keywords Constants Numeric constants Real numbers – include decimal points Integers – w/out decimal points No commas, symbols (only – sign) or blank spaces Exponential notation is used

QBasic Statement Components Constants Character string constants Alphanumeric data Only one set of double quotes Length of a string – max 32,767 characters Variables Can only store one value at a time Referred to by addresses Variables are named Only first 40 characters are recognized in QBasic QBasic does not differentiate between upper & lowercase Use descriptive variable names

QBasic Statement Components Numeric Variables Supplied by the programmer or Calculated during program execution Begins with a letter, followed by letters, digits, and periods Cannot have blank spaces

QBasic Statement Components String Variables Stores character strings Begins with a letter followed by letters or digits and always end with a $ Keywords Cannot be used as variable names READ, LIST, PRINT, LET and END

Simple QBasic Statements CLS – Clear Screen Documenting a Program REM Single quotation mark (‘) Can be used anywhere in the program REM **** This program was created by *** ‘ This program was created by

Simple QBasic Statements Assigning Values to Variables Assignment Statement LET keyword is optional LET Rate = .0825 LET Tuition = 50.00 Heading$ = “Inventory Report” Classification = 4

Simple QBasic Statements Arithmetic Operations Composed of numeric constants, numeric variables, and arithmetic operators +, -, /, *, ^ LET Tuition = Hours * 50 Order of Operations - PEMDAS

Simple QBasic Statements Displaying Results PRINT PRINT Heading$, Tuition would result in: Your tuition amount is 400.00 Displaying Literals Group of characters containing just about anything PRINT “JUNK $%^ 4567” would result in: JUNK $%^ 4567

Simple QBasic Statements END Stops program execution Immediate Window Execute statements as soon as ENTER is pressed

Simple QBasic Statements HELP F1 key or HELP menu Highlight menu option & then press F1 or right mouse button Press ESC to close HELP screen Alt-H for list of HELP topics Smart Editor