 Functions/Subroutines  Write it once, use it as many times as you want.

Slides:



Advertisements
Similar presentations
Intermediate Robotics Getting to the Next Level Guiding Question: How might I move the robot consistently, accurately, and predictably? –Review basics.
Advertisements

Procedures and Functions. What are they? They are both blocks of code that can be reused to perform specific task. However there is a difference: Function-
PROBLEM SOLVING TECHNIQUES
Documentation Letts Study Guide Information Systems - IT Chapter 19.
Repeating Actions While and For Loops
From the NXT top menu Connect desired hardware as indicated Enter a command in the box indicated from the menu provided Repeat for all 5 boxes.
Week 4 Approaches – Psuedo Code. Last week Introduced the basic concepts Sequential Conditional branching Looping This week Methods to describe problems.
Problem Solving Through Coding Names. PROBLEM SOLVING PROCESS UNDERSTAND THE PROBLEM: READ OR LISTEN TO THE PROBLEM. MAKE A PLAN TO SOVLE THE PROBLEM-
The graphing calculator can be a great checking tool or a fast way to answer a multiple choice question. Example – suppose you graphed the following and.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
Lecture 7: Objects and Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
Flowol subroutines Subroutines are used to:  Simplify your code to make it easier to read (or for someone.
Unit B065 – Coding a solution PREP WORK 1)Make sure you keep a work log / diary. Use the table on page 16 of the hand book as a template 2)Keep a bibliography.
Teaching is not just a process of imparting knowledge to an attentive child. Learning needs to be engaging, social and interactive. It is also vital that.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
Hello My Name Is… Introductory Presentation. Opening Activity Think about the following: 1.When you are feeling sad, how do you act? 2.How would someone.
Using Waits, Loops and Switches WAIT please!. Waits, Loops and Switches Pre-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
MSW Logo By Awin 9s.
Computational Thinking – Lesson 3 Lesson Objective To be able to construct an algorithm and flowchart for a given problem.
Available at: Lesson 3.5 – Program Light Sensor in Autonomous Mode Program Light Sensor in Autonomous Mode.
VendorVision Overview. The Dashboard The “Dashboard” is your main landing page. This is where you will (1.) manage your tasks, (2.) view items expiring.
Variables. Todays Lesson  In todays lesson you are going to:  Learn to use variables  Learn to ask for user input  Learn to save the users response.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
1. FINISHING FUNCTIONS 2. INTRODUCING PLOTTING 1.
1 AVCE ICT Unit 7 - Programming Session 8 – Documenting your programs.
Week 61 Introduction to Programming Ms. Knudtzon C Period Tuesday October 12.
EXAMPLE 3 Draw common tangents Tell how many common tangents the circles have and draw them. a.b. c. SOLUTION a. 4 common tangents 3 common tangents b.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
 Multivariate Numerical Integration Rida Assaf Western Michigan University
HNC Flow Chart 1 IT Systems Analysis and Design SSADM – Design.
CS 104 – Fall 2011 Exploring Computer Science Build Your Own Blocks September 19, 2011.
USING PYTHON AND VISUAL PYTHON TO TRACK HEALTH BY, CHASE FORTIER.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
Engineering H193 - Team Project Spring Quarter Gateway Engineering Education Coalition P. 1 Guidelines for Flow Charts and Pseudocode Week 5 Day 1.
Annotation. Lesson Objectives Unpack the considerations and process for analysing floor plans Annotate your preferred floor plan design Recap the minimum.
LOGO WHAT IS IT? HOW TO USE IT AND HOW USEFUL CAN IT BE?
Program Design & Development EE 201 C7-1 Spring
Chapter 7: Designing solutions to problems OCR Computing for A Level © Hodder Education 2009.
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Programming – Algorithms (Flowcharts)
GC101 Introduction to computers and programs
Lesson Objectives Aims You should be able to:
Intro CS – Loops & Creating Shapes
Introductory Presentation
Learning Objective: to be able to design programs that use sequencing.
ALGORITHMS & FLOWCHARTING II
Whole school homework projects
How to Fix Windows 10 Update Error 0x ?.
MECHANICAL ROBOT DESIGN.
Gaming with conditionals
Week 2 – Basic Constructs 1
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Collecting Offset Measurements in TopSURV
Designing an Algorithm
An Introduction to VEX IQ Programming with Modkit
Which way does the robot have to turn to get to the charger?
Using a Drawing Robot to Make Angles (Using Rotations)
Programming Fundamentals (750113) Ch1. Problem Solving
Gaming with conditionals
Introduction to Programming
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
By Sanjay and Arvind Seshan
Programming Fundamentals (750113) Ch1. Problem Solving
Menu System.
Using Waits, Loops and Switches
Using a Drawing Robot to Make Angles (Using Rotations)
Starter Look at the hand-out.
Presentation transcript:

 Functions/Subroutines  Write it once, use it as many times as you want.

 When you produced your routines for a ‘robot’ to go around the corridor, some of the actions needed to be repeated such as:  Turn right  Forward N number of steps  It might have been useful to create routines within the overall routine to do these.

 We can and these are subroutines.  We can use flowcharts to represent them.  We can use a predefine process block to represent where a ‘call’ to a subroutine is.  We can then do a flowchart for the subroutine

 Produce a flowchart for a menu system it should:  Present the user with a menu  takes in a user inputted numerical value for options in a menu;  Options are ▪ To calculate the area of the floor of a rectangular room ▪ To calculate the area of circle  Each option should lead to a subroutine to perform that action.

 Produce a test plan for problem 7.1

 Adapt your line follower ideas so that the robot can cope with an object on the track.  What are the limitations of your solution?  What are the advantages?  Group2.java on the website has some code that may be useful.

 Task  Draw a flowchart of your design.  Test your design on paper/screen/moving the robot by hand.  Program the robot based on your design.  It is expected that we will carry on with this next week. It is also expected that you might have to do this more than once.