Sha Tin Methodist College F.4 Computer Studies Pascal Programming.

Slides:



Advertisements
Similar presentations
The simple built-in data types of the C language such as int, float, - are not sufficient to represent complex data such as lists, tables, vectors, and.
Advertisements

 2000 Prentice Hall, Inc. All rights reserved Fundamentals of Strings and Characters String declarations –Declare as a character array or a variable.
Current Assignments Homework 5 will be available tomorrow and is due on Sunday. Arrays and Pointers Project 2 due tonight by midnight. Exam 2 on Monday.
MIPS Assembly Language Programming
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter 10 Introduction to Arrays
Chapter 10.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Fundamentals of Strings and Characters Characters.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 9 Structures and Sequential Access Files.
©2004 Brooks/Cole Chapter 8 Arrays. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Sometimes we have lists of data values that all need to be.
Chapter 9: Arrays and Strings
Introduction to Programming with C++ Fourth Edition
Chapter 8 Arrays and Strings
Principles of Procedural Programming
Manipulating Strings.
Introduction. In today’s session… What is programming? Why should I learn programming? Course Outline Introduction to Programming Language Introduction.
FOR DOWNTO Suppose you want to write a FOR-DO loop where the control variable is decreased with each repetition of the loop. Pascal provides the reserved.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
Lists in Python.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
STRINGS & STRING HANDLING FUNCTIONS STRINGS & STRING HANDLING FUNCTIONS.
Chapter 8 Arrays and Strings
Procedures and Functions Computing Module 1. What is modular programming? Most programs written for companies will have thousands of lines of code. Most.
Java ProgrammingtMyn1 Java Programming Timo Mynttinen Mikkeli University of Applied Sciences.
Java Script: Arrays (Chapter 11 in [2]). 2 Outline Introduction Introduction Arrays Arrays Declaring and Allocating Arrays Declaring and Allocating Arrays.
EGR 2261 Unit 9 Strings and C-Strings  Read Malik, pages in Chapter 7, and pages in Chapter 8.  Homework #9 and Lab #9 due next week.
C++ PROGRAMMING: PROGRAM DESIGN INCLUDING DATA STRUCTURES, FIFTH EDITION Chapter 10: Strings and string type.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Arrays.
Web Database Programming Week 3 PHP (2). Functions Group related statements together to serve “a” specific purpose –Avoid duplicated code –Easy maintenance.
Higher Grade Computing Studies 3. High Level Language Constructs Higher Computing Software Development S. McCrossan 1 Simple Data Types Integer: An integer.
Exam Format  90 Total Points  60 Points Writing Programs  25 Points Tracing Code/Algorithms and determining results  5 Points Short Answer  Similar.
Applications Development
An Introduction to Programming with C++ Fifth Edition Chapter 11 Arrays.
The Bubble Sort by Mr. Dave Clausen La Cañada High School.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 8: User-Defined Simple Data Types, Namespaces, and the string Type.
1 Cannon_Chapter9 Strings and the string Class. 2 Overview  Standards for Strings  String Declarations and Assignment  I/O with string Variables 
Functions: Part 2 of /11/10: Lecture 16 CMSC 104, Section 0101 John Y. Park 1.
1 STRINGS String data type Basic operations on strings String functions String procedures.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
2016 N5 Prelim Revision. HTML Absolute/Relative addressing in HTML.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 4 JavaScript.
C++ for Engineers and Scientists Second Edition Chapter 7 Completing the Basics.
UniMAP SEM I - 09/10EKT 120 Computer Programming1 Lecture 8 – Arrays (2) & Strings.
Chapter 8 Characters and Strings. Objectives In this chapter, you will learn: –To be able to use the functions of the character handling library ( ctype).
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Characters and Strings Functions.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
An Object-Oriented Approach to Programming Logic and Design Chapter 8 Advanced Array Concepts.
Scion Macros How to make macros for Scion The Fast and Easy Guide.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
Programming Constructs Notes Software Design & Development: Computational Constructs, Data Types & Structures, Algorithm Specification.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 9 Structures and Sequential Access Files.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Characters and Strings Dale Roberts, Lecturer Computer Science,
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.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 19 A Ray of Sunshine.
Introduction to Programming Lecture 12. Today’s Lecture Includes Strings ( character arrays ) Strings ( character arrays ) Algorithms using arrays Algorithms.
Chapter 9: Data types and data structures OCR Computing for A Level © Hodder Education 2009.
G043: Lecture 12 Basics of Software Development Mr C Johnston ICT Teacher
var variableName:datatype;
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
Chapter 7 Arrays.
CS 2308 Exam I Review.
CS 2308 Exam I Review.
Chapter (3) - Looping Questions.
Functions continued.
Fundamental Programming
Characters and Strings Functions
COMPUTING.
Presentation transcript:

Sha Tin Methodist College F.4 Computer Studies Pascal Programming

Converting a character to ASCII code: e.g. ord(“char type”); Converting an ASCII code to character: e.g. chr(“integer type”); String Comparison 10. ASCII Table and String Comparison

11. String Manipulation The length of the string: e.g. length( “ string type ” ); Selecting a character from a string: e.g. a[n]

Selecting part of string: e.g. copy(string1, integer1,integer2); String concatenation: e.g. concat(string1, string2); or “ + ” 11. String Manipulation

Convert a number into a string: e.g. str( “ integer type ”, “ string type ” ); Convert a string into numeric form: e.g. val(string1, number1, error_postion); : end of line ( “ Enter ” ) 11. String Manipulation

12. Procedures Procedure is a group of statements which can be called from different parts in a program. Global and local variables Parameter passing

13. File Handling Steps in creating a new file: 1. Declare a file variable: e.g. var phone: text; 2. Assign the file variable with a file name: e.g. assign(phone, ‘ tele.txt ’ );

13. File Handling 3. Open the file for output: e.g. rewrite(phone); 4. Write to the file: e.g. writeln(phone, variable1, variable2 … ); 5. Close the file: e.g. close(phone);

13. File Handling Steps in reading a new file: Same as steps in creating a new file except step 3 and 4: reset(phone); readln(phone, variable1, variable2 … ); End of file consideration:

14. Two dimensional array Declaration of 2D array: e.g. var A: array[1..3, 1..4] of integer; Use 2 for loops

15. Sorting Bubble Sort No. of data No. of pass No. of compariso n at each pass Max. no. of swaping NN-1N-pass no.N*(N- 1)/2

15. Sorting Procedure “ Swap ” Use 2 for loops in the main program Merge Sort The Algorithm of the sorting