Introduction to Computer Programming

Slides:



Advertisements
Similar presentations
The Web Warrior Guide to Web Design Technologies
Advertisements

Lecture 2 Introduction to C Programming
Introduction to C Programming
Principles of Programming Fundamental of C Programming Language and Basic Input/Output Function 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Chapter 2: Introduction to C++.
Introduction to C Programming
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CH1 – A 1 st Program Using C#. Program Set of instructions which tell a computer what to do. Machine Language Basic language computers use to control.
CS0004: Introduction to Programming Variables – Numbers.
EG280 - CS for Engineers Chapter 2, Introduction to C Part I Topics: Program structure Constants and variables Assignment Statements Standard input and.
Introduction to Python
Chapter 1: Introduction to Computers and Programming.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
2440: 211 Interactive Web Programming Expressions & Operators.
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Input, Output, and Processing
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Lecture #5 Introduction to C++
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Introduction to C Programming Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010 Fall.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
ORDER OF CONTENT AND INSTRUCTIONS A program in its simplest form usually contains three kinds of activity:  INPUT : The program asks the user for some.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The.
FUNCTIONS. Midterm questions (1-10) review 1. Every line in a C program should end with a semicolon. 2. In C language lowercase letters are significant.
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 1: Introduction to Computers and Programming.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
C++ First Steps.
Chapter 1.2 Introduction to C++ Programming
Chapter 9: Value-Returning Functions
Topics Designing a Program Input, Processing, and Output
Chapter 1.2 Introduction to C++ Programming
Input and Output Upsorn Praphamontripong CS 1110
BASIC ELEMENTS OF A COMPUTER PROGRAM
Chapter 2 - Introduction to C Programming
Variables, Expressions, and IO
Chapter 2 - Introduction to C Programming
Introduction to Python
Chapter 2 - Introduction to C Programming
2.1 Parts of a C++ Program.
Introduction to C++ Programming
Chapter 2: Introduction to C++.
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Presentation transcript:

Introduction to Computer Programming Just Basic

What is a Program? page 0 A program is a set of instructions that tells the computer what to do. Syntax is what is used to communicate with the computer, it is the grammar rules of the computer language. When creating a program the creator must use the correct Syntax.

What is the Purpose of Programming? The purpose of programming is to: use computers to solve problems caused by computers Teach a computer to do something Computer program includes step by step descriptions of generative, decision-making, and response processes: what it does and how it interacts with you.

Syntax A Program must use syntax in order to execute. Syntax is made up of symbols, commands, statements or keywords recognized by a Program. A BASIC program must include the following rules: “quotation marks” around data to appear on the screen. ;semicolon to show separation (between sentences, and questions from answers). A Label is used to organize code and is any word that is contained in brackets. It is a place to branch or goto during program execution (these cannot be seen in the execution of the program)

Color Coded Syntax Syntax within a JustBasic program is color in coded: Labels are black Statement/commands are blue Variables are blue green Functions are burgundy Values are red Output is green

Statements and Commands A line which has an instruction for the computer is considered a statement/command. There are several commands or statements used for programming in BASIC. These commands, statements or special keywords tell the computer to do something. For example, one of the simplest commands in BASIC is the PRINT statement. There are also statements of condition known as: Conditional statements

Variables BASIC uses functions to operate a program. Some functions used in BASIC are considered Variables. There are two types of variables Numeric Variables String Variables

Functions This statement defines a function. The function can return a string value, or a numeric value. A function that returns a string value must have a name that ends with the "$" character. A function that returns a numeric value must not include a "$" in its name. Zero or more parameters may be passed into the function. A function cannot contain another function definition, nor a subroutine definition. Note that the opening parenthesis is actually part of the function name. Do not include a space between the name and the opening parenthesis, or the code generates an error.

Numeric Variables Are created when a value is assigned Can be any number Used to perform operations (adding, subtracting, square root, etc.) And are used to perform numeric operations Can be predefined or user defined: Examples of predefined: A=6, health=25 Numeric variables hold either a double-precision floating point value, or an integer

String Variables Any character or group of characters. This function is followed or differentiated by a $ and can be predefined or user defined. Cannot perform calculations When assigning a value to a string, the value must be enclosed in Quotation marks Examples of predefined: A$=“no”, Name$=“John Doe”.

Values