Algorithms A Central Heating system Start Is temp <19

Slides:



Advertisements
Similar presentations
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.
Advertisements

Exercise (1).
Revision.
Flow Control Analysis & Design Tool: Flowcharts
Creating Flowcharts Principles Of Engineering
Documentation Letts Study Guide Information Systems - IT Chapter 19.
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Chapter 1 Pseudocode & Flowcharts
Session Objectives# 24 COULD code the solution for an algorithm
Finding the mean from a frequency table E.g. the following table shows the mean height of 30 students in our class. Find the mean height Height (x cm)
Developing logic (Examples on algorithm and flowchart)
The Program Design Phases
What is a Flowchart? Why are they used? How to draw them.
NameSymbolFlowchart use OvalThis is used at the start and at the end of a program to start and stop the program. Flow lineThis shows which way the logic.
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
CSC103: Introduction to Computer and Programming
CMSC 104, Version 9/01 1 The Box Problem: Write an interactive program to compute and display the volume and surface area of a box. The program must also.
A453 Exemplar Password Program using VBA
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Pseudocode Demo for Payroll.c
DECOMPOSITION. KEY TERMS  Structured programming  Functionality  Structure Charts  Stepwise refinement  Modularity.
1. Chapter 12 Inserting Shapes and WordArt 3 Inserting Shapes, WordArt, and More Create shapes, text boxes, and WordArt to add visual appeal to a Word.
CSEB114: Principle of programming
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
Input, Output, and Processing
By the end of this session you should be able to...
Software Life Cycle What Requirements Gathering, Problem definition
Math on the Mind Model y = –2x + 4 with a table of values and a graph.
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
Flowcharts.
Flowcharts and Algorithms. Review of Terms  A computer is a machine that can represent and manipulate data –Ultimately the data and the instructions.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process.
Computer Programming I Summer 2011
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Flowcharts
1 Algorithms Practice Topics In-Class Project: Tip Calculator In-Class Project: Drawing a Rectangle.
Examples of Flow Charts Pseudocodes
Flowcharts. Learning Objectives To learn how to break down tasks How to create a flowchart.
Algorithms and Pseudocode
4) Design the logic to control the motor on a simple remote control car. There are two buttons on the remote control for the motor. If neither button is.
Flow chart of the program Start Input a password Is it greater than 6 characters No Is it greater than 6 characters Is it greater than 12 characters yes.
Lesson 2 Inputs. Lesson objectives To understand how inputs can be used to control an output To consider how to make mimics more realistic.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Algorithms and Flowcharts
Programming revision Revision tip: Focus on the things you find difficult first.
Creating Flowcharts Principles of Engineering
Creating a Flowchart Computer Integrated Manufacturing
GC101 Introduction to computers and programs
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Output “Funds not available”
Introduction to Flowcharting
CS111 Computer Programming
Creating Flowcharts Principles of Engineering
ALGORITHMS AND FLOWCHARTS
Creating Flowcharts Principles of Engineering
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Pseudocode & Flowcharts
Lesson 3 Sub-Routines.
ALGORITHMS AND FLOWCHARTS
Game Controller Lesson Two.
Introduction to Programming
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Creating Flowcharts Principles of Engineering
UMBC CMSC 104 – Section 01, Fall 2016
Top-down technique / Stepwise Refinement and Algorithms
Creating Flowcharts Principles Of Engineering
Creating Flowcharts Name of PowerPoint CIM Name of Lesson
Introduction to Programming
Presentation transcript:

Algorithms A Central Heating system Start Is temp <19 Turn Heating on Is temp >20 Turn Heating off

Algorithms Calculate the area of a rectangle What mathematical calculation do you have to perform on these two inputs? What two inputs do you need to calculate the area of a rectangle? Height Width Multiplication

Start Input width Input Height Area = width x height OUTPUT area Stop

Pseudocode Input value If value >= 1 THEN If value >= 10 THEN Output “value OK Else Output “value not OK” ENDIF Return to input

Input key If key arrow pressed Move left Move right Move down Move up

Pseudocode Press key If key = right arrow THEN move right Else If key = left arrow THEN move left If key = up arrow THEN move up If key = down arrow THEN move down ENDIF

A garden centre has a loyalty card scheme that gives members a 10% discount if they spend more than £50. If any customer spends more than £100, then they get a 5% discount on top of any discounts they may already have. Create a flow chart to show how this program might work

Start No disc No disc Disc = 15% Disc = 10% YES NO NO NO YES YES YES Loyalty card Spend > £100 Spend > £50 YES NO NO No disc NO Loyalty card Taken out YES YES YES NO No disc Disc = 15% Disc = 10%

Start No disc Disc = 10% Disc 5% Disc = 15% NO YES NO YES NO YES Loyalty card Spend > £50 No disc YES NO NO YES Disc = 10% Spend > £100 Disc 5% NO YES Disc = 15%

Start No disc Disc = 15% Disc = 10% NO NO YES NO YES YES Loyalty card Spend > £100 Spend > £50 NO NO No disc YES NO YES YES Disc = 15% Disc = 10%

Start Loyalty card scheme No disc Disc 5% Disc = 10% Disc = 15% NO NO Spend > £100 Spend > £50 NO NO No disc YES YES Loyalty card Loyalty card YES NO NO YES Disc 5% Disc = 10% Disc = 15%

Pseudocode INPUT spend INPUT loyalty card IF spend > 100 THEN IF loyalty card = YES THEN discount = 15% ELSE IF loyalty card = NO THEN discount = 5% ENDIF ENDIF IF spend < 100 THEN IF spend > 50 THEN IF loyalty card = YES THEN discount = 10% ELSE IF loyalty card = NO THEN no discount ENDIF ENDIF ENDIF IF spend < 50 THEN no discount ENDIF