A Level Computing#BristolMet Session Objectives#U2 S2 MUST describe the steps of an algorithm using a program flowchart SHOULD explain the data types and.

Slides:



Advertisements
Similar presentations
Lecture 4: Javascript Basics Javascript is a scripting language based on pieces of C, C++, shell scripts, Pascal, Java, etc. Scripts – loosely typed C++
Advertisements

Logic & program control part 3: Compound selection structures.
Introduction to Flowcharting
PSEUDOCODE & FLOW CHART
Programming Logic and Design Fourth Edition, Introductory
Chapter 1 - An Introduction to Computers and Problem Solving
Subject: Information Technology Grade: 10
Chapter 2 - Problem Solving
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Java Planning our Programs Flowcharts Arithmetic Operators.
Session Objectives# 24 COULD code the solution for an algorithm
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Chapter 2: Input, Processing, and Output
Chapter 1 Program Design
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Chapter 3 Planning Your Solution
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
DCT 1123 Problem Solving & Algorithms
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
CIS Computer Programming Logic
A Level Computing#BristolMet Session ObjectivesU2#S10 MUST describe the difference between constants, local and global variables SHOULD explain why constants.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Input, Output, and Processing
Introduction to Computer Programming Using C Session 23 - Review.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
1 Program Planning and Design Important stages before actual program is written.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing a Line of Text in a Web Page 7.3 Another JavaScript.
The Hashemite University Computer Engineering Department
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The.
A Level Computing#BristolMet Session Objectives#U2 S3 MUST use/read programme flow charts accurately SHOULD adapt the calculator programme to include a.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Algorithms and Pseudocode
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
GCSE Computing: Programming GCSE Programming Remembering Python.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
PROBLEM SOLVING. What is a Problem? A problem is a situation that needs to be resolved.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Algorithms and Flowcharts
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
ALGORITHMS AND FLOWCHARTS
Topics Designing a Program Input, Processing, and Output
A451 Theory – 7 Programming 7A, B - Algorithms.
INTRODUCTION TO PROBLEM SOLVING
Introducing Instructions
Chapter 2: Input, Processing, and Output
Chapter 1. Introduction to Computers and Programming
The Selection Structure
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Algorithms & Pseudocode
We are starting JavaScript. Here are a set of examples
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
Topics Designing a Program Input, Processing, and Output
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Topics Designing a Program Input, Processing, and Output
Variables Here we go.
Chapter 2: Input, Processing, and Output
Data Types and Maths Programming Guides.
Introduction to Programming
Presentation transcript:

A Level Computing#BristolMet Session Objectives#U2 S2 MUST describe the steps of an algorithm using a program flowchart SHOULD explain the data types and basic program constructs required for a given program COULD create a simple one function calculator in Javascript Create a multiple function calculator with end or continue screen.

A Level Computing#BristolMet Keywords

A Level Computing#BristolMet Planning a programme Before attempting to write a programme, the solution needs to be planned. This helps the coder to see what they want to achieve and how they can best achieve it by breaking the problem down into logical steps. Methods for planning a programme solution include the use of the flow charts and pseudocode. FLOW CHARTS – the following symbols are used START STOP Area = Width x Height Start or Stop a programme Represent a process i.e adding Represents input or output values A decision symbol i.e Yes or No, or a choice of paths START STOP Input Width Input Height Output Area What will this programme do?

A Level Computing#BristolMet Flow Charts Simple flow chart with decision symbols. START Check the weather outside Is it raining ? Wear waterproof trousers Don’t wear waterproofs STOP IF Yes Else No TASK 1: Create a flow chart for making a cup of coffee.

A Level Computing#BristolMet 3 basic program constructs RECAP: Can you remember what the 3 basic program constructs are? Sequence IterationSelection TASK 2: Prepare to explain the program constructs needed in your coffee program

A Level Computing#BristolMet Data Types (Variable Type) In databases we already know that the software needs to know what type of data is being held in each data field. This is known as the field type. Similarly when writing programs it is necessary to understand the type of data that will be held by the variables used in the program. The reasons are the same as databases: i)It provides limited validation of data ii)Certain operations can only be performed on certain data types (NB: the prompt() command in Javascript is set to string therefore it cannot automatically perform mathematical operations ) iii)Memory can be efficiently allocated to store data.

A Level Computing#BristolMet Data Types (Variable Type) For this course, the data types you need to know about are: Integer Floating Point Real Boolean Character String TASK 3: In your course folders, make notes on each type giving examples. Data Types Resource - Teach-ICT TASK 4: Prepare to discuss the variable types which could be used for your coffee program.

A Level Computing#BristolMet Creating a coding solution TASK 4: Now create a flow chart for a program that will add any two numbers and give the result. ANSWER: Answer = N1 + N2 START STOP Input Number 1 Input Number 2 Output Answer Pseudocode Declare variables for number1, 2 and answer Prompt input number1 and store as variable Prompt input number2 and store as variable Answer of number1 + number2 stored as variable Alert user of answer as message.

A Level Computing#BristolMet Coded Solution Now let’s code this solution. Remember javascript goes inbetween … tags TIPS: Declare variables at the start of the program var x, var y, parseInt() This will convert the data type to an Integer. (NB prompts are treated as string) Var1 = parseInt(prompt(‘Enter something here?’)) Notice the 2 brackets needed to close the 2 open brackets Alert() To display output

A Level Computing#BristolMet Multiple Function Calculator TASK 5: Create a calculator which can perform all 4 maths operations. You must design the solution first by creating a flow chart. EXT: How could the efficiency of this program be improved??

A Level Computing#BristolMet Flow Chart for 4 Operations Calculator Answer = N1 + N2 START STOP Input Number 1 Input Number 2 Output Answer Answer = N1 / N2 STOP Input Number 1 Input Number 2 Output Answer Answer = N1 * N2 STOP Input Number 1 Input Number 2 Output Answer Answer = N1 - N2 STOP Input Number 1 Input Number 2 Output Answer Which Calculator If = + If = - If = * If = /

A Level Computing#BristolMet Keywords