Controlling Computers with Programs When you create a computer program you are creating a set of instructions that tell the computer exactly and completely.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Intermediate Code Generation
1 Chapter Five Selection and Repetition. 2 Objectives How to make decisions using the if statement How to make decisions using the if-else statement How.
The Assembly Language Level
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
CS 111: Introduction to Programming Midterm Exam NAME _________________ UIN __________________ 10/30/08 1.Who is our hero? 2.Why is this person our hero?
Creating Computer Programs lesson 27. This lesson includes the following sections: What is a Computer Program? How Programs Solve Problems Two Approaches:
INTRODUCTION T.Najah Al_Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System CS240.
July 13 th.  If/ Else if / Else  Variable Scope  Nested if/else's  Switch statements  Conditional Operator.
VBA Modules, Functions, Variables, and Constants
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Program Design and Development
Slides prepared by Rose Williams, Binghamton University Chapter 3 Flow of Control Loops in Java.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Java An introduction. Example 1 public class Example1 { public static void main (String [] args) { System.out.println (“This is the first example”); int.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
Guide To UNIX Using Linux Third Edition
CSCI/CMPE 4341 Topic: Programming in Python Chapter 3: Control Structures (Part 1) – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
1 MATERI PENDUKUNG OPERATOR Matakuliah: M0074/PROGRAMMING II Tahun: 2005 Versi: 1/0.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
VB .NET Programming Fundamentals
Programming Concepts MIT - AITI. Variables l A variable is a name associated with a piece of data l Variables allow you to store and manipulate data in.
Python quick start guide
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
High-Level Programming Languages: C++
CIS Computer Programming Logic
Flow of Control. 2 Control Structures Control structure: An instruction that determines the order in which other instructions in a program are executed.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
PHP Logic. Review: Variables Variables: a symbol or name that stands for a value – Data types ( Similar to C++ or Java): Int, Float, Boolean, String,
CPS120: Introduction to Computer Science Decision Making in Programs.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Algorithm Design.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
ASP-5-1 ASP Control Structures Colorado Technical University IT420 Tim Peterson.
I Power Higher Computing Software Development High Level Language Constructs.
JavaScript, Fourth Edition
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Java Programming Fifth Edition Chapter 5 Making Decisions.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Controlling Program Flow with Decision Structures.
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Chapter 7: Repetition Structure (Loop) Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Unit 1 Review By: Mr. Jacobs.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
Chapter 7 JavaScript: Control Statements, Part 1
Java Programming Fifth Edition
JavaScript Syntax and Semantics
Expressions and Control Flow in JavaScript
JavaScript: Control Statements.
The structure of computer programs
11/10/2018.
Computer Science Core Concepts
ICT Gaming Lesson 3.
Flow of Control.
Basic Programming Concepts
Javascript Chapter 19 and 20 5/3/2019.
C Language B. DHIVYA 17PCA140 II MCA.
Presentation transcript:

Controlling Computers with Programs When you create a computer program you are creating a set of instructions that tell the computer exactly and completely what to do. Computers operate using a language that is usually unique to each brand and model, called machine code.

Machine Coding The Binary System – All 0s and 1s Hexadecimal - A Base16 number system Assembly Language – A human–readable form of machine code for every microprocessor. Assemblers – convert the assembly language programs into machine code.

Object-oriented Programming C and C++ are procedural languages. They are designed to allow programmers to solve problems by defining the procedures to use. With OOPS, programmers have a means to describe the relationships between collections of code and variables known as objects.

Torque Script Torque Script is typeless and does not require forward declarations of variables. Also Torque Script requires scope prefixes (like % signs for local and $ for global variables. Variables typically require a “type” to specify how much memory will be used. Torque script does not require this.

Some Definitions Expressions – Statements that can be evaluated Variables – chunks of memory where values are stored. Arrays – A data structure that allows a collective name to be given to a group of elements of the same type. Strings – like an array of single characters

Loops Loops are used for repetitive tasks With While loops the condition is evaluated before the loop body statements are executed. For Loops While Loops

Functions Functions save work. Once you’ve written code to solve a problem, you can roll the code into a function and reuse it whenever you encounter that problem again. You can also use the code with different starting parameters.

Conditional Expressions A conditional or logical expression is an expression that can only evaluate to one of two values: true or false. There are also explicit logical operators for combining the logical values of true and false.

Branching The term branching refers to the idea that code can follow different execution paths. The simplest way to select the next thing to do in a program based on conditions is to use the if statement. The if-else statement can be used for multiple branches. These statements can also be nested one inside the other.

Debugging and Problem Solving Missing Semicolon at the end of a statement Missing slash in a double-slash operator Missing % or $ (scope prefix) from variable names Using uninitalized variables Mixing global and local scope prefixes Unbalanced parentheses or braces