Variables & getting info from the user

Slides:



Advertisements
Similar presentations
Interactive Scripts: Intermediate. Error Trapping When requesting user input, it is imperative that the users enter the data in the desired format. Dropdown,
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Using the Degree Works Planner. Click on the Planner tab in the students Degree Works account.
VOCABULARY MOD2-22.
Benchmark Series Microsoft Access 2010 Level 1
Review Game Lessons 2 & 3 Review Game Lessons 2 & 3 Read the questions and choose the answer you feel best fits. To review the correct answer click on.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
Detecting univariate outliers Detecting multivariate outliers
Early Registration System Version 1.1 Student’s Manual Developed by Ovais Khan.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech June 2011.
© English Language Testing Ltd Taking the Password Knowledge with Reading and Writing Test.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
How to Setup Step for Yahoo . Yahoo Go to and click on Yahoo Mail. Click on the “Sign Up” link that appears.
A453 Exemplar Password Program using VBA
Code Club Session 2 Dance Party. What will we learn ?  How to change the background  How to create animations  How to make objects talk to each other.
9/18/2015Slide 1 The homework problems on comparing central tendency and variability extend the focus central tendency and variability to a comparison.
Section 3 Calculations National 4/5 Scratch Course.
Basic layout for KS 2,3 and 4 starting point and rough layout Ability to switch between number line and graph Rule checking Mapping table with user entry.
Section 2 Variables National 4/5 Scratch Course. What you should know after this lesson What a variable is Where variables are stored How to get data.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Objects and Methods in Scratch 1. 2 Scratch environment Stage is at upper right (where actors act and information is displayed) Sprite is another name.
© English Language Testing Ltd Taking the Password with Reading and Writing Test.
NOBELCON Version 4.0 USER MANUAL. Get started Obtain Excel spreadsheet with coordinates. Open spreadsheet in Excel. If there are multiple sets of coordinates.
Click your mouse to continue. Creating a New Mail Merge Document When you need to create a form letter but do not have an existing main document, you can.
RIGHT Mouse Button Formatting Cut Copy Paste Save LEFT Mouse Button MAIN BUTTON Single clicks Double clicks Drag Highlight.
Introduction to Programming with RAPTOR
Scratch Programming Lesson 4 Question asking and answering.
Microsoft Access 2010 Chapter 10 Administering a Database System.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Excel 2010 Formatting Columns and Rows Excel 2010 / Mr. Bitenas In this lesson you will learn how to insert, delete, and resize Columns and Rows.
Sanjay Johal. Introduction(1.1) In this PowerPoint I will be explaining :  The purpose of the code for each of the two given programs, e.g. to carry.
Darek Sady - Respondus - 3/19/2003 Using Respondus Beginner to Basic By: Darek Sady.
AS Level ICT Data entry: Creating validation checks.
Computer Programming Modeling a Passive Solar Home.
Lesson 1. Security At the menu bar at the top you will see the word Tools. Click your mouse on Tools scroll down to Macro. Move the Mouse over and down.
Controlling Program Flow with Looping Structures
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Perfecto Mobile Automation
While loops. Iteration We’ve seen many places where repetition is necessary in a problem. We’ve been using the for loop for that purpose For loops are.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
Vex Robotics program three: using motors and sensors together.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech.
Introduction to Scratch We will be using the Scratch Environment today, so please log in to the Scratch website (scratch.mit.edu)
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Excel Tutorial 8 Developing an Excel Application
August 31 Intro to CS.
Scratch for Interactivity
Madlib-Input, Strings, and Lists in Scratch
Introduction to Microsoft Access
Scratch: iteration / repetition / loops
PowerPoint Activity 5: To Be Determined…
Introduction to Programming
Developing an Excel Application
Unit 2 Getting Started With
Introduction to Programming
Formatting Cells and Ranges
Scratch: selection / branching/ if / If…else / compound conditionals / error trapping by Mr. Clausen.
Chapter 1 Minitab Recipe Card
A few tricks to take you beyond the basics of Microsoft Office 2007
Word offers a number of features to help you streamline the formatting of documents. In this chapter, you will learn how to use predesigned building blocks.
Introduction to TouchDevelop
JavaScript Form Validation
Additional Topics in VB.NET
Creating a Simple Game in Scratch
Quick Guide for Online Ordering
Executive Reports, Instructions and Documentation
Presentation transcript:

Variables & getting info from the user Mr. clausen

variables A variable “names” a memory location in which information can be stored. The stored information is referred to as the variable’s value. During the course of a program, a variable’s value can be changed. The variables name does not change. It is customary to use all lowercase letters for a variable name unless the name is more than one word. If the name is more than one word, capitalize the first letter of each word starting with the second word. This is called “camel case” (i.e. lengthSide). Variable names cannot have spaces in their names.

Creating variables in scratch Click on the Data category, then click on the “Make a Variable Button”. In the dialog box that appears, give the variable a good descriptive name (no one letter variable names) that would describe what it represents in the program. Decide whether this variable should be available to all sprites or just the current sprite, and click “OK”.

Scratch variables continued Your variables appear below the “Make A Variable Button”. If the box next to the variable name is checked, the values of your variables will appear in the top left corner of the stage.

Getting input from the user From the Sensing (light blue) section of commands, use the “ask and wait” command. From the Data command list, use the “set to” command. Pair these commands together as shown below, using the “answer” button from the Sensing menu. “Set to” has a drop down menu to select which variable to use (you need to create the variable first).

error trapping a numeric range After getting input from the user, we can use a Repeat Until statement to “error trap” the input (check for valid input within an acceptable range). Remember, “and” means BOTH conditions must be met. Ask the user for input first. Then check if the input is within the expected range in the condition of a Repeat Until. Give the user feedback if the input is not within the range, and ask the user for the information again in the “body” of the repeat until loop.

error trapping text response After getting input from the user, we can use a Repeat Until statement to “error trap” the input to see if the user entered the text we requested. Remember, “or” means if one or more is true, the whole expression is true. ChooseBackdrop.sb2