OCR AS Level F452: 3.2.3 Data types and data structures 3.2.3 Data types and data structures a. define different data types, eg numeric (integer, real),

Slides:



Advertisements
Similar presentations
Copyright © 2002 Pearson Education, Inc. Slide 1.
Advertisements

Etter/Ingber Arrays and Matrices. Etter/Ingber One-Dimensional Arrays 4 An array is an indexed data structure 4 All variables stored in an array are of.
SCIP Optimization Suite
Single Variable and a Lot of Variables The declaration int k; float f; reserve one single integer variable called k and one single floating point variable.
Analysis of Algorithms CS Data Structures Section 2.6.
Arrays. INTRODUCTION TO ARRAYS Just as with loops and conditions, arrays are a common programming construct and an important concept Arrays can be found.
1 PHP Statement Constructs Server Scripting. 5-2 Basic Statement All Statements end in a semicolon. Statements are delimited from the HTML code by enclosing.
D IVIDE AND CONQUER STRATEGY, D ATA TYPE, A LGORITHM DESIGN AND PRACTICE. Week 13 Mr.Mohammed Rahmath.
 Demonstrate use of a “for loop” in the design and development of a Java program to calculate the total of a one-dimensional array of 6 integers.  Design.
Programming with Collections Collections in Java Using Arrays Week 9.
Arrays. Arrays  When a value is to be used in a program, a variable is declared to hold that value  What about storing the results of exams for a large.
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
Program Design and Development
1 Arrays b An array is an ordered list of values An array of size N is indexed from zero to N-1 scores.
ECE122 L11: For loops and Arrays March 8, 2007 ECE 122 Engineering Problem Solving with Java Lecture 11 For Loops and Arrays.
1 Arrays  Arrays are objects that help us organize large amounts of information  Chapter 8 focuses on: array declaration and use passing arrays and array.
29 November JavaScript: Arrays and Iterations Functions.
Arrays Data Structures - structured data are data organized to show the relationship among the individual elements. It usually requires a collecting mechanism.
Arrays. Arrays  When a value is to be used in a program, a variable is declared to hold that value  What about storing the results of exams for a large.
Principles of Procedural Programming
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
1. Reference  2  Algorithm :- Outline the essence of a computational procedure, step by step instructions.  Program :- an.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
 For Loops › for (variable set; condition; incremental or decrement){ // loop beginning › } // loop end  While loops › while (condition) { // beginning.
Microsoft Access Using Visual Basic Routines. Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink.
Arrays in C++ Numeric Character. Structured Data Type A structured data type is a type that stores a collection of individual components with one variable.
Array Processing.
Arrays and 2D Arrays.  A Variable Array stores a set of variables that each have the same name and are all of the same type.  Member/Element – variable.
CSCI 130 Array Searching. Methods of searching arrays Linear –sequential - one at the time –set does not have to be ordered Binary –continuously cutting.
19/10/20151 Data Structures Arrays. 219/10/2015 Learning Objectives Explain initialising arrays and reading data into arrays. Design and write routine/s.
Problem Solving for Programming Session 8 Static Data Structures.
I Power Int 2 Computing Software Development High Level Language Constructs.
# 1# 1 Searching andSorting What is selection sort? What is bubble sort? What is binary search? CS 105 Spring 2010.
Chapter 6: Arrays: Lists and Tables
Data Structures and Algorithms Introduction to Algorithms M. B. Fayek CUFE 2006.
Chapter overview This chapter focuses on Array declaration and use Bounds checking and capacity Arrays storing object references Variable length parameter.
The PC GadgetMaster II Stepper Motor Control Developed by Frank Shapleigh Edited by Jim Tuff.
Foundation Studies Course M.Montebello Arrays Foundation Studies Course.
Data Structures: Arrays Damian Gordon. Arrays Imagine we had to record the age of everyone in the class, we could do it declaring a variable for each.
Python Arrays. An array is a variable that stores a collection of things, like a list. For example a list of peoples names. We can access the different.
I Power Higher Computing Software Development High Level Language Constructs.
C Programming – Part 3 Arrays and Strings.  Collection of variables of the same type  Individual array elements are identified by an integer index 
Susie’s lecture notes are in the presenter’s notes, below the slides Disclaimer: Susie may have made errors in transcription or understanding. If there.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 9 Arrays  Read Bishop, Sections 6.1 to 6.3.  Homework #9 and Lab #9 due next week.  Quiz #5 next.
ALGORITHMS.
CS-I MidTerm Review Hao Jiang Computer Science Department Boston College.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Language Find the latest version of this document at
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
REEM ALMOTIRI Information Technology Department Majmaah University.
Arrays (Chapter 5)‏ Definition Applications One-Dimensional –Declaration –Initialization –Use Multidimensional.
Arrays. Arrays are objects that help us organize large amounts of information.
Lecture #15 ARRAYS By Shahid Naseem (Lecturer). 2 ARRAYS DEFINITION An array is a sequence of objects of same data type. The objects in an array are also.
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Third Edition by Tony Gaddis.
CS 1428 Final Exam Review. Exam Format 200 Total Points – 60 Points Writing Programs – 45 Points Tracing Algorithms and determining results – 20 Points.
Chapter 9: Data types and data structures OCR Computing for A Level © Hodder Education 2009.
Introduction toData structures and Algorithms
7 - Programming 7J, K, L, M, N, O – Handling Data.
Sections 10.1 – 10.4 Introduction to Arrays
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
3.2.3 Data types and data structures
Written by Al.So. Software solutions
Data Structures and Algorithms
Chapter 5: Arrays: Lists and Tables
CS 1428 Final Exam Review.
CS 1428 Final Exam Review.
C# Revision Cards Data types
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Presentation transcript:

OCR AS Level F452: Data types and data structures Data types and data structures a. define different data types, eg numeric (integer, real), Boolean, character and string; select and use them appropriately in their solutions to problems; b. define and use arrays (one- and two dimensional) for solving simple problems, including initialising arrays, reading data into arrays and performing a simple serial search on a one-dimensional array;

a. define different data types, eg numeric (integer, real), Boolean, character and string; select and use them appropriately in their solutions to problems; OCR AS Level F452: Data types and data structures

Data types Variable typeExample Chara StringHello world BooleanTRUE Integer35 Float12.56 Some languages also support more obscure types like Date and Currency. OCR AS Level F452: Data types and data structures

b. define and use arrays (one- and two dimensional) for solving simple problems, including initializing arrays, reading data into arrays and performing a simple serial search on a one-dimensional array; OCR AS Level F452: Data types and data structures

Arrays Definition: A data structure made up of a series of variables all of the same type, grouped under one identifier. Elements are accessed using an index. playerNames = [“Bob”, ”Rich”, ”Steve”, ”Jo”] playerNames(0) = “Ted” print(playerNames(1)) OCR AS Level F452: Data types and data structures

Pete myNames Each section in the Array is called an Element. Each Element can be accessed by referencing its location in the Array. var myNames = new Array(6); myNames[2]=“Pete"; [0][1][2][3][4][5] Elements OCR AS Level F452: Data types and data structures

Serial search Serial search just means checking each element one after the other until you find the one that you want. The most efficient way to do this in a 1D array is using a loop. count = 0 strWanted = “Steve” playerNames = [“Bob”, ”Rich”, ”Steve”, ”Jo”] while count<length(playerNames) if playerNames(count)== strWanted: print(“Player is in element “ + count) else: count = count + 1 print(“Finished”) OCR AS Level F452: Data types and data structures