7 - Programming 7J, K, L, M, N, O – Handling Data.

Slides:



Advertisements
Similar presentations
ARDUINO CLUB Session 1: C & An Introduction to Linux.
Advertisements

Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
ECS15 for and sequence. Comments  Another way to repeat.
Program Design and Development
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 3: Control Structures (Part 1) – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
Chapter 1 Program Design
Data Types. Every program must deal with data The data is usually described as a certain type This type determines what you can do with the data and how.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
 For Loops › for (variable set; condition; incremental or decrement){ // loop beginning › } // loop end  While loops › while (condition) { // beginning.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
1 Week 2 n Organizational matters n Fortran 90 (subset F): Basics n Example programs in detail.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
Programming, an introduction to Pascal
Repetition. Loops Allows the same set of instructions to be used over and over again Starts with the keyword loop and ends with end loop. This will create.
Introduction to Programming Lecture Note - 2 Visual Basic Programming Fundamentals.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Cosc175/operators1 Algorithms computer as the tool process – algorithm –Arithmetic: addition,subtraction,multiplication,division –Save information for.
Arithmetic Expressions Addition (+) Subtraction (-) Multiplication (*) Division (/) –Integer –Real Number Mod Operator (%) Same as regular Depends on the.
COIT29222 Structured Programming 1 COIT29222-Structured Programming Lecture Week 02  Reading: Textbook(4 th Ed.), Chapter 2 Textbook (6 th Ed.), Chapters.
Three Two One Whenever you attempt to solve a problem, there are certain steps you should follow. 1.Define the problem 2.Propose and evaluate.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Algorithms and Pseudocode CS Principles Lesson Developed for CS4 Alabama Project Jim Morse.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Programming revision Revision tip: Focus on the things you find difficult first.
Chapter 3 Using Variables, Constants, Formatting Mrs. UlshaferSept
G. Pullaiah College of Engineering and Technology
Fundamentals of Programming I Overview of Programming
Data Types and Structures
A451 Theory – 7 Programming 7A, B - Algorithms.
Data Types and Expressions
Component 1.6.
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
BASIC ELEMENTS OF A COMPUTER PROGRAM
Making Choices with if Statements
Chapter 4 – Fundamental Data Types
7 - Programming 7P, Q, R - Testing.
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Data Types, Identifiers, and Expressions
A451 Theory – 7 Programming 7A, B - Algorithms.
The Selection Structure
CMSC201 Computer Science I for Majors Lecture 03 – Operators
DFC1023 PROBLEM SOLVING AND PROGRAM DESIGN
Data Types, Identifiers, and Expressions
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Coding Concepts (Basics)
` Structured Programming & Flowchart
Coding Concepts (Data- Types)
Starting Out with Programming Logic & Design
Data Types and Data Structures
Algorithms computer as the tool process – algorithm
Training & Development
SELECTIONS STATEMENTS
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Flowcharts and Pseudo Code
Java: Variables, Input and Arrays
design OO words Debug Variables Data types
Data Types and Maths Programming Guides.
DATA TYPES There are four basic data types associated with variables:
Variables and Constants
COMPUTING.
Constants, Variables and Data Types
Building Java Programs
Presentation transcript:

7 - Programming 7J, K, L, M, N, O – Handling Data

Learning Intentions To develop an understanding of how data is stored and handled in algorithms

Assessment Outcomes 7J - Define the terms variable and constant as used in an imperative language 7K – Use variables and constants 7L – describe the data types integer, real, Boolean, character and string 7M – select and justify appropriate data types for a given program 7N – perform common operations on numeric and Boolean data 7O - Use one-dimensional arrays.

7J/K – Define the terms variables and constants Constants are stored items of data that do not change as the program runs. For example when working out the area of a circle: Pi = 3.14 Radius = User input integer Area = Pi x (Radius x Radius) Print Area Variables are stored items of data that can change as the program runs. For example the current score in a game: Score = 0 If Player hits target: Score = Score + 10

7L/M – Data types Data Type Type of Data Use in a program Integer A whole number, such as 3, 45,‐453 To input a users age, marks on a test, the day of the month. Real (Float) A number with a fractional part (decimal) such as 3.14, 9.5, 100.1 To set up Pi in a program String Zero or more characters that could include letters, punctuation, symbols, and numbers For storing names, filenames, user inputted answers. Char A single character, could include letters, punctuation, symbols, and numbers For storing single letters, choice ‘a’, ‘b’, ‘c’, etc. Boolean A boolean variable has the value True or False. Age verification checks.

7N - perform common operations on numeric and Boolean data Numerical Data Data Type Operations Integer Arithmetic operations Comparison operations   Real Arithmetic operations (but not DIV and MOD, which only apply to whole numbers) Boolean Logical operations Arithmetic operations Comparison operations eg: 25 + 3 = 28 eg: 456 > 34 is true • + (addition) <  (less than) ‐ (subtraction) >  (greater than) * (multiplication) <= (less than or equal to) / (division) >= (greater than or equal to) DIV (integer division) <>  (not equal to) MOD (modulus) = (equal to) Logical Operations: Not And Or

7O - Use one-dimensional arrays Arrays are a data structure that stores multiple values of the same data type. For example the top scores in a video game: TopScores = [90, 80, 75, 60] The benefits of using arrays are: Code is easier to follow and therefore easier to debug and maintain. A group of data can be easily processed using a FOR loop. Arrays are addressed by counting from 0: TopScores = [90, 80, 75, 60] This means that each element can be addressed individually. print(TopScores[2]) This code would output ‘75’ 0 1 2 3

Crib – Fundamental topics Define Sequencing and give an example Define Selection and explain how it is achieved using: If, Elif, Else Case Define Iteration and give an example of how it is achieved using: For Loops While Loops Repeat Loops

Exam Questions I have ripped off every exam question for Unit 1 – Fundamentals of Computing.. Answer all of the questions in the A, B, C folder. Self Assess them all. Get me to check them!