Term 2, 2011 Week 1. CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting.

Slides:



Advertisements
Similar presentations
Programming Paradigms and languages
Advertisements

1 C++ Syntax and Semantics The Development Process.
Elementary Data Types Prof. Alamdeep Singh. Scalar Data Types Scalar data types represent a single object, i.e. only one value can be derived. In general,
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Elementary Data Types Scalar Data Types Numerical Data Types Other
Aalborg Media Lab 28-Jun-15 Software Design Lecture 8 “Arrays”
CS1061 C Programming Lecture 7: Floating Point A. O’Riordan, 2004.
Chapter 8 Arrays and Strings
Chapter 1 Program Design
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Creating Web Page Forms
Software Design & Development Software Design & Development Programming Types Event Driven Programming Event driven programming Is a type of programming.
Graphical Tree-Based Scientific Calculator: CalcuWiz Will Ryan Christian Braunlich.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
SOFTWARE.
© 2011 Pearson Education, publishing as Addison-Wesley 1 Arrays  Arrays are objects that help us organize large amounts of information  Chapter 6 focuses.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CHAPTER FOUR COMPUTER SOFTWARE.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
1. Produce a folio of tasks that demonstrate a progression in acquiring and applying programming knowledge (ie. learn Visual Basic) 2. Learn about computer.
Numeric Processing Chapter 6, Exploring the Digital Domain.
Cis303a_chapt03-2a.ppt Range Overflow Fixed length of bits to hold numeric data Can hold a maximum positive number (unsigned) X X X X X X X X X X X X X.
Chapter 8 Arrays and Strings
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Input, Output, and Processing
Visual C++ Programming: Concepts and Projects
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 9 Arrays.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
1 © 2002, Cisco Systems, Inc. All rights reserved. Arrays Chapter 7.
Term 2, 2011 Week 5. CONTENTS Data and information Information purposes Types of data – Integer data types – Floating point numbers – Character data types.
Lecture #5 Introduction to C++
MIS 3020 ABAP Programming Lecture 2 Elementary & User Defined Types Domains, Elements, Variables/Fields.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Arrays.
Introduction to Programming with RAPTOR
ITGS Databases.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
Chapter One An Introduction to Programming and Visual Basic.
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.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Files Tutor: You will need ….
Programming Games Logic. Slide show. Range input. Storage. Datatypes. Binary numbers. Homework: Catch up. This includes uploading projects to your server.
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
Creating Animations, Working with Graphics, and Accessing Data Lesson 9.
Java Software Solutions Lewis and Loftus Chapter 6 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Objects for Organizing Data.
PLC ARCHITECTURE – Memory 2 by Dr. Amin Danial Asham.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Chapter 1: Introduction to Computers and Programming.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
The purpose of a CPU is to process data Custom written software is created for a user to meet exact purpose Off the shelf software is developed by a software.
Creating Database Objects
Unit 2 Technology Systems
ARRAYS (Extra slides) Arrays are objects that help us organize large amounts of information.
Topics Introduction Hardware and Software How Computers Store Data
Data Types and Structures
Other Kinds of Arrays Chapter 11
Topics Introduction Hardware and Software How Computers Store Data
Data Types and Data Structures
Creating Database Objects
Presentation transcript:

Term 2, 2011 Week 1

CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting languages Scripting languages Features of programming and scripting languages – Objects and properties, events and actions Objects and properties, events and actions – Storing and using data Storing and using data Strings Decimal numbers Precision problems with financial and scientific data Arrays Images, sounds and videos – Processing structures and commands Control structures – Sequence – Selection – Iteration Questions

Four stages: analysis, design, development and evaluation. For this area of study you will be required to produce solutions to information problems using programming language.

Manipulating data to produce solutions for clients often cannot be performed with standard software such as spreadsheets. Clients usually need to have the solution built to serve their own purposes (usually to inform, persuade, educate or entertain). Purpose-designed software solutions are usually produced using a general-purpose programming language that allows both for the manipulation of objects and data and for various types of input and output.

Programming languages The main features of PL’s that differentiate them from scripting languages are the ability to handle more varied types of data easily, to do more complicated processing, and to process larger amounts of data. Information is easily manipulated with the use of arrays, which can be thought of as tables of data, and other complex data structures.

PL’s lack ready-built standard interfaces for input and output. This means they are more flexible in the range of solutions that can be produced, but can also mean it is more time and effort consuming to create a useful product. This is why user interfaces are often programmed using a scripting language, and complex data processing is performed using a general purpose PL.

Scripting languages SL is a PL that is designed to program within a particular application, or embedded within another application to provide extra functionality. E.g. ActionScript is used to program Flash animations, JavaScript is embedded into webpages. Has simpler syntax and fewer programming constructs than a PL as it is limited by the features of the host application.

Scripting does not usually require complicated coding (usually no more than 5-10 lines because it only has one main function). Can be to send a user to another screen depending on some condition, to perform a simple calculation, to validate some input, to change an attribute etc. Script is often attached to an object already in the application, such as a button or object. This can often mean that all coding is not in the same location as it is with a PL; this can create problems keeping track of extensive amounts of scripting code. Using a SL means that much of the user interface does not need to be built, saving time and effort.

A programming or scripting language is a method of communicating instructions to a computer. Each has a set of formal specifications regarding the use of objects, key words and commands in the language. This language enables a programmer to specify: – What actions or processing will be performed under various circumstances within the program – How the data will be stored in the computer – Exactly what type of data will be processed.

Objects and properties, events and actions Programming and scripting languages often have a range of objects that can be manipulated using a mouse, such as buttons, labels, images and drawings. These objects have various properties, associated events and actions. This object-oriented type of programming was invented to allow the developer to build a solution easily. Many of these objects are common to applications and are increasingly in general programming languages.

Often familiar to the user and have easy-to- change visual properties (i.e. Colour, size and position). Have familiar events and actions attached (mouse click, mouse hover etc.). Each type of language has objects with properties and associated actions>often similar, yet different. Usually a greater range of objects in a PL. Languages support various types of data formats, structures and objects, and these are manipulated using a variety of programming structures and commands.

Storing and using data Data and information are stored in a computer- based solution in various ways. Main type of storage are variables (or memory locations) that usually only hold one item of data; more complex variable structures, such as lists, arrays and database tables that hold more than one item; and some data held in the visual and non-visual properties of objects. Some data may need to be stored in a file on a hard disk when the application is closed.

Each variable has a number of properties: – Name of the variable – Type of data stored in the variable – Amount or size of the data The data stored in variables (working data) is needed as the applications are executed. Variables usually need to be declared so that the program knows how much data needs to be stored in the memory location, the type of data and the size of the data. When developing purpose-built solutions, various types of data need to be entered, stored, manipulated/processed for output.

Numbers may need to be entered and there may be whole numbers, decimals, dates and true/false (Boolean) information. The data may need to be stored as constant values in the solution which do not usually change, such as the cost of a product or a percentage discount. All data is stored in digital format as binary digits. The size of the fundamental group is 8 bits (i.e. ‘5’ is stored as ‘ ’).

Strings Sequences of characters and used to store words. Different languages allow different lengths of string. A string length of 255 characters is a common maximum length. Can be operated on as whole words, sentences, or as individual characters. Individual characters within a string can be processed using an index number. Compared on a letter-by-letter basis, checking the first character, then the next and so on.

Decimal numbers Numbers that include a fractional or decimal part. Split into the mantissa and the exponent. – The mantissa holds all of the digits with a decimal point after the first digit. – The exponent holds the power of ten by which the mantissa must be multiple to regain original number. Also called real numbers, floating point numbers and double numbers in some languages.

Precision problems with financial and scientific data Where financial or scientific data is entered, it is stored as a decimal value and formatted as the user selects (e.g. Price could be stored as and formatted for output as $ The extra decimal places need to be carefully programmed to ensure errors don’t occur when they are rounded off.

Arrays Can be more than one-dimensional. Two- dimensional arrays, such as player names and scores, are like tables or matrices of data with two indexes corresponding to the position down and across the table (like a spreadsheet). Any two-dimensional item, such as a screen or board game layout, can use a matrix to represent data. Can be referenced by Row = 3, Col = 2

Images, sounds and videos Programming and scripting languages can also use images, sounds and videos. Image, sound and video data are stored in standard formats/ They are usually imported into a container object that has properties such as size, position and coloured borders. Changing the size of the object container changes the image size automatically. Data is stored in binary form, but what that data actually represents depends on the program that is accessing the data.

Different programs interpret the data differently, hence why opening a file in another program can show some strange results. Colours are the main components of images and are represented as pixels on a screen using RGB or CMYK systems.

Questions What is a programming and scripting language? What is the difference between a general-purpose and a scripting programming language? What are the two main components of a programming or scripting language? What is object-oriented programming? What is a variable? Explain character, string and Boolean variables. What is an array? List some common formats of images and sounds.