Intro to Event-Driven Programming
|
|
- Amber Jennings
- 5 years ago
- Views:
Transcription
1 Unit 5. Lessons 1 to 5 AP CS P We roughly follow the outline of assignment in code.org s unit 5. This is a continuation of the work we started in code.org s unit 3. Occasionally I will ask you to do additional programming assignments in code.org s App Lab. Lesson 1 Level 1. Vocabulary We will work on this later. Level 2. Video. Watch it when you can Level 3. Welcome to Design Mode Lots of useful information. Level 4. Design Mode. Do this exercise Level 5. Event-Driven Programming Lots of useful information. Level 6. onevent Level 7. Practice! Add another button Intro to Event-Driven Programming Project. Create a new App Project. Change the background color property of the screen. Add a button. Text should be Random Turn Change the background color, font size, button size Change the id to turnbtn Add a second button. Text should be Move Change the background color, font size, button size Change the id to movebtn Add event handlers for each button. When turnbtn is clicked, the turtle should turn to a random direction between 0 and 360 degrees. When movebtn is clicked, the turtle should move 25 pixels forward but no lines should be drawn. Level 8. Event-Driven Programming Patterns Step 1 - Design Mode. Add UI elements to the screen. Give meaning ids to the elements Step 2 - Code Mode. Add event handlers and any other code that Step 3 - Write the code for the event handling function Step 4 - Run. Test. Debug. Level 9. Choosing Good IDs and Rules About IDs Please read this section. Level 10. Descriptive IDs Skip this. You should already be giving your UI elements meaningful IDs.
2 Level 11. Play with different event types While the other event types can be very useful, we will not do much with them until later in the unit. You can skip this level. Level 12. Learning How to Debug and Common Types of Errors. Know the difference between syntax and logic errors. Level 13. Debugging Event-Driven Programs: IDs Do this exercise where you debug an existing program. Level 14. Debugging Event-Driven Programs: IDs Do this second exercise where you debug an existing program. Level 15. Debugging Unexpected Behavior When faced with code, a very useful behavior is to first review the code, predict what will happen, run the code, and then reflect about the results. It does not matter if your prediction was correct or not. It is the process of reviewing the code, predicting, execution, and reflection that leads to a deeper understanding of the code. Note. In this program, there are two separate event handlers that respond to the same event for the same UI element. This is bad; do not do this. Level 16. Debugging Logical Errors In this exercise, there is a logic error that you need to find and fix. Level 17. setposition and Screen Dimensions. setposition allows you to change the location and size of a UI element. The screen dimensions are 320 by 450 Level 18. Using setposition When you click on a button, it moves to the center of the screen Level 19. Using setposition and randomnumber Level 20. Design Mode: Add a label Do this exercise Level 21. How to Add Images in Design Mode Very useful information Level 22. Add an Image and Make a Chaser Game! Just have fun with this and try some of their suggestions. For instance, what happens if you make the image move to a random location whenever the user moves the mouse over the image? Can you make the image hide when the mouse goes down and show when the mouse goes up? Level 23. CS Principles Rapid Survey! Skip it. Project. Start a new App Project. There are three buttons: one makes the turtle move forward 25 pixels, one button makes the turtle turn right, and the third button makes the turtle draw something. In my example, the draw button draws a square. The buttons should display icons and no text. The turtle draws nothing when it moves, only when the draw button is pressed. Make it look pretty. Share it with me.
3 Lesson 2 Making Multi-Screen Apps Level 1. Vocabulary and Overview Please read this. Level 2. Design Mode: Layering and Deleting Lots of useful information. When you run the program, messages should appear in the Debug Console. If you do not see the Debug Console (and the messages), click the Code tab. Notice that a different message should appear when you click on the blue, yellow, or red circles but message for the red circle never appears and the yellow message only appears if you click on a specific part of that circle. Figure out what s happening. Add code so that when the user clicks anywhere on the screen, HEY! is printed in the Debug Console. Notice how this is handled differently from the other UI elements. Level 3. Add onevent from Design Mode! This is a short level. Level 4. Exploring console.log Do this very short exercise. We will use console.log a lot. Level 5. Printing to the console. Another page on how useful printing to the console can be. Level 6. Predict what will happen. Look over the code and predict what will happen when you run it. Then run it. It is not important to predict correctly (at least at this point), but you should understand why the code behaves the way it does. Level 7. Which comes first? This is an excellent, and short, exercise that demonstrates the difference between the click, mousedown, and mouseup events. But read the code and predict before you run it; it will help you understand it better. Level 8. Use console.log to Test Overlapping Objects and the Screen Please do this. It goes over what we discussed in level 2. Level 9. Making and Using Multiple Screens Lots of very useful information about screens. This is a good reference page. Level 10. Design Mode: Adding a Screen First of a two-part exercise. Add a second screen with a button. Dress it up. You write the code in the next level. Be sure to give the new screen a decent id. Level 11. Adding Code: Switching Screens with setscreen Write the code so you can switch between the two screens Level 12. Guided Example: Making a Multi-Screen Chaser Game This outlines the improved version of the simple chaser game which you ll make over the next three levels. Level 13. Add A Welcome Screen Create the Welcome screen and be sure to make it the default screen Level 14. Add a Full Screen Image to act as Background to Game Do this level. Level 15. Add a "game over" screen and finalize the game Complete the game. Avoid dead-ends -- the user should be able to get between all the screens appropriately, and play the game. When you are done, share the program with me.
4 Lesson 3 Building an App: Multi-Screen App Skip this. Lesson 4 Notes Controlling Memory with Variables Feel free to work your way through code.org s lesson 4 but here is my take on the material. Variables are named storage locations in memory. Variables can store many types of data, but we will only work with numerical data for now. var x; Creates a variable named x. Use the keyword var only when creating a variable. x = 6; Assigns x a value of 6; the assignment operator is Always evaluate the expression on the right; assign the result to the left x = x + 1; console.log( x ); Rules for variable names; Variable names can contain letters, digits, underscores, and dollar signs Start with a letter (though technically you may also use $ and _ ) Variable names are case-sensitive Reserved words (e.g. var) cannot be used as variable names. var num = 10; num = num + num; num = num + num; console.log( num ); + has two meanings If the values to the left and right are numbers, then it means addition. If at least one of the values to the left or right is a string (something in quotes), then it means concatenation. Concatenation means to join/append values together var a = 3; var b = 4; a = a + b; b = a + b; console.log( "a " + a + " b " + b ); The write command prints the text on the screen (whereas console.log prints in the Debug Console). We will use the write command only occasionally. var n1 = randomnumber( 1, 3 ); var n2 = randomnumber( 1, 3 ); var n3 = n1 + n2; write( n1 + " + " + n2 + " = " + n3 ); (one of nine possible results)
5 The promptnum command causes an input dialog box to appear and returns the number that the user enters. var num = promptnum("enter a number"); Lesson 4 Exercises on Variables 1) What is displayed? var William = 1; William = 2; William = 3; console.log( William ); 3) What is displayed? var Manuel = / 2; console.log( Manuel ); 5) What is displayed? var Miti = 5; var Arushi = 8; Miti = Arushi; Arushi = Miti; write( Miti + ", " + Arushi ); 7) The code below generates an error and does not print 6. What is the problem? 2) What is displayed? var Jennla = 12 / 2 + 1; write( "Jennla" ); 4) What is displayed? var Sam = 28 / 10; console.log( Sam ); 6) What is displayed? var Collin = -4; var Mike = 1; var Levi = 7; Levi = Collin; Collin = Mike + 8; Mike = Levi + Collin; console.log( Collin + ", " + Mike + ","+ Levi ); 8) The code below generates an error. Which line is causing the error? var Ruth = 6; console.log( ruth ); 9) If the user enters 2, what is displayed? var Mary = promptnum("number please"); Mary = 2 * Mary; console.log( Mary ); Mary = 2 * Mary; console.log( Mary ); Mary = 2 * Mary; 11) What is the smallest number that may be displayed? 12) What is the largest number that may be displayed? var Joanna = 100; Joanna + 2 = Joanna; write( Joanna ); 10) If the user enters 3, what is displayed? var Kyle = promptnum("enter a number."); Kyle = Kyle * Kyle * Kyle; Kyle = Kyle + Kyle; console.log( Kyle ); var Karan = randomnumber(1, 6); var Bernadette = randomnumber(1, 6); var Louie = Karan + Bernadette; write( Louie );
6 Lesson 4 Programs 1) Start a new project. The program should ask the user to enter the length and width of a rectangle. Then it prints the length and width and area as shown in the figure to the right. Use the outline provided below as a starting point. var length = promptnum("enter the length"); var width = ; var area = ; write( ); write( ); write( ); 2) Write a program where the user enters the bases and height of a trapezoid and then displays those numbers and area of the trapezoid. You may create a new project or write over the first program. The finished program should display something like the figure to the right. Obviously, this is just one example and your program should work for any three numbers. 3) Write a program that generates four random numbers, each one [1, 5], and then displays those numbers and their average. There should only be one write command and it display something like the example on the right. Since you will be using the randomnumber function, you very likely will get a different result every time you run the program. 4) Find the answers to the following questions about the promptnum function. a) If the user clicks the OK button on the dialog box without entering anything, what happens? var x = promptnum("number"); write ( x ); b) If the user enters tree, or some other non-number, and clicks the OK button, what happens? c) If the user enters the number 88 and then clicks the CANCEL button, what happens?
7 Lesson 5 Building an App: Clicker Game Level 1. Vocab Please read this. Level 2. Clicker Game Demo Click Run and see how it runs. Make sure you have the sound on. Try to lose. This is what you are eventually building in this lesson. Level 3. Changing Elements on Screen The settext command is very useful. Do this level. Level 4. All the Basics You Need. Level 5. Using Variables in Apps! Fix the mistake in the code. Level 6. Debugging Problem! This one contains a subtler error. Find it and fix it. Level 7. Free response: Spot and Fix the Bug Skip this. Level 8. Creating Variables in the Right Place Please read this. It is important. Level 9. Make Count Down Work Level 10. Bug Squash! Run the program and fix the problem. Level 11. Bug Squash! Run the program and fix more problems. Level 12. Bug Squash! Still more problems to fix. Level 13. Using Global Variables Level 14. Tracking Lives Level 15. Having Your App Make Decisions If statements are introduced; something very useful and important to programming. Level 16. Add Your Own if Statement Level 17. Add a Reset Button Level 18. Bug Squash! Run the program and fix the problem. Level 19. Bug Squash! Follow the directions to find the bug; then fix it. Level 20. Bug Squash! Follow the directions to find the bug; then fix it. Level 21. Make Your Own Clicker Game Skip it. Level 22. AP Practice - Create PT - Choosing an Abstraction Skip it.
8 After Lesson 5 Notes UI elements: Label and Text Input The Label UI is meant for information that the user cannot change. The Text Input UI is for when you want the user to enter a small amount of data on a single line. Text Input elements have a useful property called placeholder. This is default text that disappears as soon as the user types in the box. To get the information displayed in a UI, use one of the following functions. gettext( UI id ) or getnumber( UI id ) To change the information in a UI, use one of the following functions. settext( UI id, message ) or setnumber( UI id, number ) Use getnumber and setnumber when working with numbers; otherwise use gettext and settext. Here is an example of how to use these UI elements and the above functions. To the right is a simple program. It has three UI elements (from top to bottom): a text input, a button, and a label. Enter your age, click the button, and it will tell you when you were born (or close to it). Below is the code. To the right is the program after I entered 60 and clicked the button. When the user clicks the button, the getnumber function gets the number from the Text Input UI and assigns it to age. After calculating the approximate birth year, we use the settext function to change what is displayed in the label. If Statements
9 If Statements. These are a fundamental part of a programming language. They allow you to control the flow of a program; to execute or not execute statements based on some criteria. Here are three common forms. if ( condition ) { code A if ( condition ) { code B else { code C if ( condition ) { code D else if ( condition ) { code E else { code F condition is a Boolean expression that evaluates to either or. Here are six examples of valid Boolean expressions. Assume x is a variable that has already been declared and has been assigned a value. You may also && or in a Boolean expression as needed In the if / else statement, if the condition is true, then you execute code and skip code. If the condition is false, then you skip code and execute code. With if / else if statements: You may have as many else if as needed. You execute only the code associated with the first true condition; everything else is skipped. You do not have to end with else. Local vs Global Variables. A variable declared within a function is a local variable; a variable declared outside of all functions is a global variable. A local variable exists only in the function it was declared in. When the function is completed, the variable is deleted. The next time the function is called, the local variable is created again. A global variable exists throughout the program and can be used in all functions. It is deleted only when the program is closed. In general, it is safer to use local variables when you can and only use global variables if you have to. It is very common for programs to have both local and global variables.
10 After Lesson 5 Exercises 1) If Max has an initial value of 7, what is displayed? 2) If Max has an initial value of 5, what is displayed? 3) If the user enters 41, what is displayed? var Max = randomnumber(1, 10); if ( Max > 5 ){ Max = 3 * Max; Max = Max + 1; write( Max ); 4) If the user enters 20, what is displayed? 5) If the user enters 28, what is displayed? 6) If the user enters 33, what is displayed? 7) If the user enters -4 a) there is an error. b) there is no error, but nothing is displayed c) C is displayed d) none of the above 8) If the user enters 28, what is displayed? 9) If the user enters 33, what is displayed? 10) If the user enters 8, what is displayed? 11) What integers does the user have to enter to get F to be displayed? var Dylan = promptnum("number"); if ( Dylan >= 20 ) { write( "A" ); if ( Dylan >= 30 ) { write( "B" ); else { write( "C" );
11 12) If the user enters 12, what is displayed? 13) If the user enters 5, what is displayed? 14) If the user enters 18, what is displayed? var Shazeb = promptnum("number"); if ( Shazeb!= 12 ) { Shazeb = Shazeb + 3; else { Shazeb = Shazeb + 1; if ( Shazeb >= 10 ) { Shazeb = 2*Shazeb; else { Shazeb = 3*Shazeb; write( Shazeb ); Below to the right is code for a program that calculates a person s pay for the week. The user enters the number of hours worked and how much they get paid per hour. However, they get paid extra for every hour they work after 40 hours. Problems 15 to 18 all refer to this program. 15) Based just on the code, how many UI elements are on the screen and what are their IDs/names? 16) If someone works 20 hours and gets paid $8 an hour, what will the program display? 17) If someone works 41 hours and gets paid $10 an hour, what will the program display? 18) If someone works 43 hours and gets paid $10 an hour, what will the program display? onevent("btncalculate", "click", function(event) { var hours = getnumber( "hoursinput" ); var hr_wage = getnumber( "wageinput" ); var pay; if (hours <= 40) { pay = hours * hr_wage; else { pay = 40*hr_wage + (hours - 40)*2*hr_wage; settext("paylabel", "Pay: $" + pay); ); 19) If the user enters 600, the program prints 4. Why? var n = promptnum("number"); if ( n = 3 ) { n = n + 1; write( n );
12 20) Based just on the code, how many UI elements are on the screen and what are their IDs/names? 21) if the user clicks on the button and n1 is 8 and n2 is -4, what will be displayed? 22) if the user clicks on the button and n1 is 8 and n2 is 2, what will be displayed? The code to the right uses two new Turtle functions: getx and gety which return the x and y coordinates of the Turtle s location. 23) Describe what the user will see on the screen if they keep clicking the button again and again. penup(); turnto(90); //Turn to the right onevent("btnmove", "click", function(event) { moveforward(25); var x = getx(); var y = gety(); if (x > 320) { moveto( 0, y ); ); 24) Based just on the code, how many UI elements are on the screen and what are their IDs/names? 25) Why does the program call gettext instead of getnumber? Note. The above program will display Correct! when the user enters Great. But it is case-sensitive.
13 Questions about global and local variables. 26) What is displayed in the label after the user clicks on btn1? 27) What is displayed in the label after the user clicks on btn1 a total of three times? 28) What is displayed in the label after the user clicks on btn1 and then clicks on btn2? 29) What is displayed in the label after the user clicks on btn2 twice and then clicks on btn1 once? 30) What is displayed in the label after the user clicks on btn1 twice and then clicks on btn2 twice? NOTE. The variable b in the first function and the variable b in the second function are different variables (that happen to have the same name). 31) What is displayed in the label after the user clicks on btn1 a total of three times? 32) If the user clicks on btn1 once and then clicks on btn2... a) 6, 3 is displayed b) an error occurs when btn2 is clicked on. var a = 0; onevent("btn1", "click", function(event) { var b = 10; a = a+1; b = b+2; settext("label", a + ", " + b); ); var a = 50; onevent("btn1", "click", function(event) { var b = 20; a = a+3; b = b+4; settext("label", a + ", " + b); ); onevent("btn2", "click", function(event) { var b = 1; a = a+10; b = b+5; settext("label", a + ", " + b); ); var k = 5; onevent("btn1", "click", function(event) { var h = 1; k = k+1; h = h+2; settext("label", k + ", " + h); ); onevent("btn2", "click", function(event) { k = k+3; settext("label", k + ", " + h); ); Note. In JavaScript, all variable declarations in a function are treated as if they were declared at the start of the function. So version A and version B do the same thing and behave in the same way. 33) What is displayed when this function is called? Version A function example(){ for (var i = 5; i < 7; i++) { var num = 10; num = 3*num; for (var i = 0; i < 4; i++) { var num = 12; num = num - 4; settext("label", i + ", " + num ); Version B function example(){ var i, num; for (i = 5; i < 7; i++) { num = 10; num = 3*num; for (i = 0; i < 4; i++) { num = 12; num = num - 4; settext("label", i + ", " + num );
14 After Lesson 5 Programs 1) Create the program to the right. The user enters two prices and the program calculates the percent change from the old to the new price. Warning. When working with decimals, very small errors (on the order of onebillionth) may appear. 2) Create the program to the right. The user enters the number of widgets they want, the price for one widget, and the tax rate. After clicking the button, the pretax total, tax, and total price appears. Don t worry about getting the costs to line up or not having 2 digits to the right of the decimal place. Warning. When working with decimals, very small errors (on the order of onebillionth) may appear. 3) When the button is clicked, generate two random numbers and display them in a label. In a second label, display whether they got doubles or not.
15 4) Write the program. Kiwis cost $4 each if you buy 6 or less but only $3 if you buy 7 or more. 5) Write the program. Every time the button is clicked, the Turtle moves to a random location on the screen. The label below the button will display Top Half if the Turtle is on the top half of the screen; otherwise it displays Bottom Half. You decide whether the exact middle counts as the top or bottom. The screen is 320 by 450 pixels. 6) This time we are selling potatoes, but the pricing is different. The first 4 potatoes cost 50 cents each. The fifth, sixth, seventh, and eighth potatoes cost 25 cents each. Every potato after 8 costs only 10 cents each. Below are some sample screen shots. 7) When the button is clicked, generate a random number [50, 100]. Then, depending on that random number, give the student a letter grade of A, B, C, D, or F.
16 8) There are two buttons and a label on the screen. When the up button is clicked, the message moves up. If the user keeps clicking the up button so that the message moves off the top of the screen, it should reappear at the bottom When the down button is clicked, the message moves down. If it goes off the bottom, it should reappear at the top of the screen. You will need to call the getxposition and getyposition functions (under UI Controls) to get the x and y coordinates of the upper-left hand corner of the label. You will also need to call the setposition function, but you ve already used that one. You will need to use global variables in the remaining programs. 9) There is one button and one label. Every time you click the button, the label shows you how many times you clicked the button. 10) This is a guess the number game. After clicking start, the user enters a number in the text input element and hits the enter key. This triggers the change event for the text input element and the program says whether the guess is too high or too low. When the program starts. After the button is clicked. After the user enters a number and then hits the enter key When the user guesses correctly, congratulate them and display the number of tries. \n will generate a line break in the text in the label (if you want that). You will need a global variable for the secret number and for the number of tries.
17 11) There is one button, two labels, and one text input on the screen. Come up with three questions that have integer answers. When the top button is clicked, do the following: Generate a random number [1, 3] and save that number in a global variable. Depending on the number, display a question in the top label (between the buttons). Erase any text in the text input element (perhaps from a previous question) and erase any text in the bottom label. After the user enters a number and hits the enter key, do the following: Get the number that the user entered. If the global number is 1, and their answer matches the correct answer for the first question, display Correct! in the bottom label. Similarly, if the global variable is 2 and they gave the correct answer for the second question, display Correct. The same goes for the third question. If their answer is not correct, display wrong in the bottom label. NOTE. If you want to get rid of the second button and react to the change event on the text input element instead, then go ahead. Your program should look something like this when it starts. The bottom label has no text in the beginning. This shows the program after the user got a question and answered it incorrectly. This shows the program after the user got a different question and answered it correctly.
Introduction to Java Unit 1. Using BlueJ to Write Programs
Introduction to Java Unit 1. Using BlueJ to Write Programs 1. Open up BlueJ. Click on the Project menu and select New Project. You should see the window on the right. Navigate to wherever you plan to save
More informationAP Computer Science Unit 1. Writing Programs Using BlueJ
AP Computer Science Unit 1. Writing Programs Using BlueJ 1. Open up BlueJ. Click on the Project menu and select New Project. You should see the window on the right. Navigate to wherever you plan to save
More informationAssessment - Unit 3 lessons 16-21
Name(s) Period Date Assessment - Unit 3 lessons 16-21 1. Which of the following statements about strings in JavaScript is FALSE? a. Strings consist of a sequence of concatenated ASCII characters. b. Strings
More informationAP Computer Science Unit 1. Writing Programs Using BlueJ
AP Computer Science Unit 1. Writing Programs Using BlueJ 1. Open up BlueJ. Click on the Project menu and select New Project. You should see the window on the right. Navigate to wherever you plan to save
More information[ the academy_of_code] Senior Beginners
[ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell
More informationIntro. Scheme Basics. scm> 5 5. scm>
Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if
More informationDefinition: A data structure is a way of organizing data in a computer so that it can be used efficiently.
The Science of Computing I Lesson 4: Introduction to Data Structures Living with Cyber Pillar: Data Structures The need for data structures The algorithms we design to solve problems rarely do so without
More informationHello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications
Hello World! Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande Chapter 1 Copyright 2009 Manning Publications brief contents Preface xiii Acknowledgments xix About this
More informationUsing Microsoft Excel
Using Microsoft Excel Formatting a spreadsheet means changing the way it looks to make it neater and more attractive. Formatting changes can include modifying number styles, text size and colours. Many
More informationAfter completing this appendix, you will be able to:
1418835463_AppendixA.qxd 5/22/06 02:31 PM Page 879 A P P E N D I X A A DEBUGGING After completing this appendix, you will be able to: Describe the types of programming errors Trace statement execution
More informationUsing Microsoft Excel
Using Microsoft Excel Excel contains numerous tools that are intended to meet a wide range of requirements. Some of the more specialised tools are useful to people in certain situations while others have
More informationTOPIC 2 INTRODUCTION TO JAVA AND DR JAVA
1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared
More informationIntroduction to Programming with JES
Introduction to Programming with JES Titus Winters & Josef Spjut October 6, 2005 1 Introduction First off, welcome to UCR, and congratulations on becoming a Computer Engineering major. Excellent choice.
More informationYour First Windows Form
Your First Windows Form From now on, we re going to be creating Windows Forms Applications, rather than Console Applications. Windows Forms Applications make use of something called a Form. The Form is
More informationArt, Nature, and Patterns Introduction
Art, Nature, and Patterns Introduction to LOGO Describing patterns with symbols This tutorial is designed to introduce you to some basic LOGO commands as well as two fundamental and powerful principles
More informationCS 051 Homework Laboratory #2
CS 051 Homework Laboratory #2 Dirty Laundry Objective: To gain experience using conditionals. The Scenario. One thing many students have to figure out for the first time when they come to college is how
More informationExcel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller
Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing
More informationHOUR 4 Understanding Events
HOUR 4 Understanding Events It s fairly easy to produce an attractive interface for an application using Visual Basic.NET s integrated design tools. You can create beautiful forms that have buttons to
More informationCSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch
CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed
More informationChapter One: Getting Started With IBM SPSS for Windows
Chapter One: Getting Started With IBM SPSS for Windows Using Windows The Windows start-up screen should look something like Figure 1-1. Several standard desktop icons will always appear on start up. Note
More informationIntro To Excel Spreadsheet for use in Introductory Sciences
INTRO TO EXCEL SPREADSHEET (World Population) Objectives: Become familiar with the Excel spreadsheet environment. (Parts 1-5) Learn to create and save a worksheet. (Part 1) Perform simple calculations,
More informationFirst Visual Basic Lab Paycheck-V1.0
VISUAL BASIC LAB ASSIGNMENT #1 First Visual Basic Lab Paycheck-V1.0 Copyright 2013 Dan McElroy Paycheck-V1.0 The purpose of this lab assignment is to enter a Visual Basic project into Visual Studio and
More informationDepending on the computer you find yourself in front of, here s what you ll need to do to open SPSS.
1 SPSS 13.0 for Windows Introductory Assignment Material covered: Creating a new SPSS data file, variable labels, value labels, saving data files, opening an existing SPSS data file, generating frequency
More informationCS 134 Programming Exercise 2:
CS 134 Programming Exercise 2: Dirty Laundry Objective: To gain experience using conditionals. The Scenario. One thing some students have to figure out for the first time when they come to college is how
More informationMaking ecards Can Be Fun!
Making ecards Can Be Fun! A Macromedia Flash Tutorial By Mike Travis For ETEC 664 University of Hawaii Graduate Program in Educational Technology April 4, 2005 The Goal The goal of this project is to create
More informationAP Computer Science Unit 3. Programs
AP Computer Science Unit 3. Programs For most of these programs I m asking that you to limit what you print to the screen. This will help me in quickly running some tests on your code once you submit them
More informationTopic Notes: Java and Objectdraw Basics
Computer Science 120 Introduction to Programming Siena College Spring 2011 Topic Notes: Java and Objectdraw Basics Event-Driven Programming in Java A program expresses an algorithm in a form understandable
More informationLab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function
Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function Due: Mar25 (Note that this is a 2-week lab) This lab must be done using paired partners. You should choose a different partner
More informationUsing Microsoft Excel
About Excel Using Microsoft Excel What is a Spreadsheet? Microsoft Excel is a program that s used for creating spreadsheets. So what is a spreadsheet? Before personal computers were common, spreadsheet
More informationExcel Tips for Compensation Practitioners Weeks Data Validation and Protection
Excel Tips for Compensation Practitioners Weeks 29-38 Data Validation and Protection Week 29 Data Validation and Protection One of the essential roles we need to perform as compensation practitioners is
More information: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics
Assignment 1: Turtle Graphics Page 1 600.112: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics Peter H. Fröhlich phf@cs.jhu.edu Joanne Selinski joanne@cs.jhu.edu Due Date: Wednesdays
More informationAdobe Flash CS3 Reference Flash CS3 Application Window
Adobe Flash CS3 Reference Flash CS3 Application Window When you load up Flash CS3 and choose to create a new Flash document, the application window should look something like the screenshot below. Layers
More informationSmoother Graphics Taking Control of Painting the Screen
It is very likely that by now you ve tried something that made your game run rather slow. Perhaps you tried to use an image with a transparent background, or had a gazillion objects moving on the window
More informationStep through Your DATA Step: Introducing the DATA Step Debugger in SAS Enterprise Guide
SAS447-2017 Step through Your DATA Step: Introducing the DATA Step Debugger in SAS Enterprise Guide ABSTRACT Joe Flynn, SAS Institute Inc. Have you ever run SAS code with a DATA step and the results are
More informationIntro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming
Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals
More informationComputer and Programming: Lab 1
01204111 Computer and Programming: Lab 1 Name ID Section Goals To get familiar with Wing IDE and learn common mistakes with programming in Python To practice using Python interactively through Python Shell
More informationWelcome to Introduction to Microsoft Excel 2010
Welcome to Introduction to Microsoft Excel 2010 2 Introduction to Excel 2010 What is Microsoft Office Excel 2010? Microsoft Office Excel is a powerful and easy-to-use spreadsheet application. If you are
More informationBoise State University. Getting To Know FrontPage 2000: A Tutorial
Boise State University Getting To Know FrontPage 2000: A Tutorial Writers: Kevin Gibb, Megan Laub, and Gayle Sieckert December 19, 2001 Table of Contents Table of Contents...2 Getting To Know FrontPage
More informationCS1046 Lab 4. Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to:
CS1046 Lab 4 Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to: Define the terms: function, calling and user-defined function and predefined function
More informationGetting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners
Getting Started Excerpted from Hello World! Computer Programming for Kids and Other Beginners EARLY ACCESS EDITION Warren D. Sande and Carter Sande MEAP Release: May 2008 Softbound print: November 2008
More informationBarchard Introduction to SPSS Marks
Barchard Introduction to SPSS 22.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data
More informationText Input and Conditionals
Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()
More informationAnimations involving numbers
136 Chapter 8 Animations involving numbers 8.1 Model and view The examples of Chapter 6 all compute the next picture in the animation from the previous picture. This turns out to be a rather restrictive
More information1. Managing Information in Table
1. Managing Information in Table Spreadsheets are great for making lists (such as phone lists, client lists). The researchers discovered that not only was list management the number one spreadsheet activity,
More informationMy First iphone App (for Xcode version 6.4)
My First iphone App (for Xcode version 6.4) 1. Tutorial Overview In this tutorial, you re going to create a very simple application on the iphone or ipod Touch. It has a text field, a label, and a button
More informationOn the Web sun.com/aboutsun/comm_invest STAROFFICE 8 DRAW
STAROFFICE 8 DRAW Graphics They say a picture is worth a thousand words. Pictures are often used along with our words for good reason. They help communicate our thoughts. They give extra information that
More informationSPSS: Basics & Entering a survey In this document the basic window of SPSS is explained and how to enter a survey.
In this document the basic window of SPSS is explained and how to enter a survey. For more information, you can visit the companion website at http://peterstatistics.com. Introduction SPSS was first released
More informationLesson 1: Writing Your First JavaScript
JavaScript 101 1-1 Lesson 1: Writing Your First JavaScript OBJECTIVES: In this lesson you will be taught how to Use the tag Insert JavaScript code in a Web page Hide your JavaScript
More informationCSCI 161 Introduction to Computer Science
CSCI 161 Introduction to Computer Science Department of Mathematics and Computer Science Lecture 2b A First Look at Class Design Last Time... We saw: How fields (instance variables) are declared How methods
More informationWe will start our journey into Processing with creating static images using commands available in Processing:
Processing Notes Chapter 1: Starting Out We will start our journey into Processing with creating static images using commands available in Processing: rect( ) line ( ) ellipse() triangle() NOTE: to find
More informationCS Programming Exercise:
CS Programming Exercise: An Introduction to Java and the ObjectDraw Library Objective: To demonstrate the use of objectdraw graphics primitives and Java programming tools This lab will introduce you to
More information4.7 Approximate Integration
4.7 Approximate Integration Some anti-derivatives are difficult to impossible to find. For example, 1 0 e x2 dx or 1 1 1 + x3 dx We came across this situation back in calculus I when we introduced the
More informationAdapted from Code.org curriculum
Adapted from Code.org curriculum Objectives Use the return command to design functions. Identify instances when a function with a return value can be used to contain frequently used computations within
More informationMicrosoft PowerPoint 2016 Part 2: Notes, Links, & Graphics. Choosing a Design. Format Background
Microsoft PowerPoint 2016 Part 2: Notes, Links, & Graphics Choosing a Design Open PowerPoint. Click on Blank Presentation. Click on the Design tab. Click on the design tab of your choice. In part one we
More informationSpeed Up Windows by Disabling Startup Programs
Speed Up Windows by Disabling Startup Programs Increase Your PC s Speed by Preventing Unnecessary Programs from Running Windows All S 630 / 1 When you look at the tray area beside the clock, do you see
More informationInstructions for Crossword Assignment CS130
Instructions for Crossword Assignment CS130 Purposes: Implement a keyboard interface. 1. The program you will build is meant to assist a person in preparing a crossword puzzle for publication. You have
More informationprintf( Please enter another number: ); scanf( %d, &num2);
CIT 593 Intro to Computer Systems Lecture #13 (11/1/12) Now that we've looked at how an assembly language program runs on a computer, we're ready to move up a level and start working with more powerful
More informationBurning CDs in Windows XP
B 770 / 1 Make CD Burning a Breeze with Windows XP's Built-in Tools If your PC is equipped with a rewritable CD drive you ve almost certainly got some specialised software for copying files to CDs. If
More informationThe Fundamentals. Document Basics
3 The Fundamentals Opening a Program... 3 Similarities in All Programs... 3 It's On Now What?...4 Making things easier to see.. 4 Adjusting Text Size.....4 My Computer. 4 Control Panel... 5 Accessibility
More informationInterface. 2. Interface Adobe InDesign CS2 H O T
2. Interface Adobe InDesign CS2 H O T 2 Interface The Welcome Screen Interface Overview The Toolbox Toolbox Fly-Out Menus InDesign Palettes Collapsing and Grouping Palettes Moving and Resizing Docked or
More informationComputer Science II Lab 3 Testing and Debugging
Computer Science II Lab 3 Testing and Debugging Introduction Testing and debugging are important steps in programming. Loosely, you can think of testing as verifying that your program works and debugging
More informationNote. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.
Robotics and Electronics Unit 2. Arduino Objectives. Students will understand the basic characteristics of an Arduino Uno microcontroller. understand the basic structure of an Arduino program. know how
More informationAdobe Illustrator. Quick Start Guide
Adobe Illustrator Quick Start Guide 1 In this guide we will cover the basics of setting up an Illustrator file for use with the laser cutter in the InnovationStudio. We will also cover the creation of
More informationHow To Upload Your Newsletter
How To Upload Your Newsletter Using The WS_FTP Client Copyright 2005, DPW Enterprises All Rights Reserved Welcome, Hi, my name is Donna Warren. I m a certified Webmaster and have been teaching web design
More informationMy First iphone App. 1. Tutorial Overview
My First iphone App 1. Tutorial Overview In this tutorial, you re going to create a very simple application on the iphone or ipod Touch. It has a text field, a label, and a button. You can type your name
More informationCS 134 Programming Exercise 3:
CS 134 Programming Exercise 3: Repulsive Behavior Objective: To gain experience implementing classes and methods. Note that you must bring a program design to lab this week! The Scenario. For this lab,
More informationLESSON B. The Toolbox Window
The Toolbox Window After studying Lesson B, you should be able to: Add a control to a form Set the properties of a label, picture box, and button control Select multiple controls Center controls on the
More informationLab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function
Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function Due: Mar13 (Note that this is a 2-week lab) This lab must be done using paired partners. You should choose a different partner
More informationDecisions, Decisions. Testing, testing C H A P T E R 7
C H A P T E R 7 In the first few chapters, we saw some of the basic building blocks of a program. We can now make a program with input, processing, and output. We can even make our input and output a little
More informationCreating Breakout - Part 2
Creating Breakout - Part 2 Adapted from Basic Projects: Game Maker by David Waller So the game works, it is a functioning game. It s not very challenging though, and it could use some more work to make
More informationActivity Guide APIs and Using Functions with Parameters
Unit 3 Lesson 5 Name(s) Period Date Activity Guide APIs and Using Functions with Parameters CS Content An API is a reference guide which catalogs and explains the functionality of a programming language.
More informationLearning to use the drawing tools
Create a blank slide This module was developed for Office 2000 and 2001, but although there are cosmetic changes in the appearance of some of the tools, the basic functionality is the same in Powerpoint
More informationUnit 7: Algorithms and Python CS 101, Fall 2018
Unit 7: Algorithms and Python CS 101, Fall 2018 Learning Objectives After completing this unit, you should be able to: Identify whether a sequence of steps is an algorithm in the strict sense. Explain
More informationThe Menger Sponge in Google SketchUp
The Sierpinsky Carpet (shown below on the left) is a 2D fractal made from squares repeatedly divided into nine smaller squares. The Menger Sponge (shown below on the right) is the 3D version of this fractal.
More informationTeach Yourself Microsoft Office Excel Topic 17: Revision, Importing and Grouping Data
www.gerrykruyer.com Teach Yourself Microsoft Office Excel Topic 17: Revision, Importing and Grouping Data In this topic we will revise several basics mainly through discussion and a few example tasks and
More information= 3 + (5*4) + (1/2)*(4/2)^2.
Physics 100 Lab 1: Use of a Spreadsheet to Analyze Data by Kenneth Hahn and Michael Goggin In this lab you will learn how to enter data into a spreadsheet and to manipulate the data in meaningful ways.
More informationQuick Start Guide. ASR Automated Systems Research Inc. Toll free: Fax:
Quick Start Guide ASR Automated Systems Research Inc. Toll free: 1-800-818-2051 Phone: 604-539-0122 e-mail: support@asrsoft.com Fax: 604-539-1334 www.asrsoft.com Copyright 1991-2014 ASR Automated Systems
More informationTaskbar: Working with Several Windows at Once
Taskbar: Working with Several Windows at Once Your Best Friend at the Bottom of the Screen How to Make the Most of Your Taskbar The taskbar is the wide bar that stretches across the bottom of your screen,
More informationAssignment 1 Photoshop CAD Fundamentals I Due January 18 Architecture 411
Due January 18 Architecture 411 Objectives To learn the basic concepts involved with raster-based images, including: pixels, RGB color, indexed color, layers, rasterization, and the sorts of operations
More informationLESSON 2 VARIABLES, OPERATORS, EXPRESSIONS, AND USER INPUT
LESSON VARIABLES, OPERATORS, EXPRESSIONS, AND USER INPUT PROF. JOHN P. BAUGH PROFJPBAUGH@GMAIL.COM PROFJPBAUGH.COM CONTENTS INTRODUCTION... Assumptions.... Variables and Data Types..... Numeric Data Types:
More informationChapter 5 Errors. Bjarne Stroustrup
Chapter 5 Errors Bjarne Stroustrup www.stroustrup.com/programming Abstract When we program, we have to deal with errors. Our most basic aim is correctness, but we must deal with incomplete problem specifications,
More informationUsing Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links
Using Dreamweaver CC 4 Creating a Template Now that the main page of our website is complete, we need to create the rest of the pages. Each of them will have a layout that follows the plan shown below.
More informationExcel Tips. Contents. By Dick Evans
Excel Tips By Dick Evans Contents Pasting Data into an Excel Worksheet... 2 Divide by Zero Errors... 2 Creating a Dropdown List... 2 Using the Built In Dropdown List... 3 Entering Data with Forms... 4
More informationIn the first class, you'll learn how to create a simple single-view app, following a 3-step process:
Class 1 In the first class, you'll learn how to create a simple single-view app, following a 3-step process: 1. Design the app's user interface (UI) in Xcode's storyboard. 2. Open the assistant editor,
More informationHow to Make a Book Interior File
How to Make a Book Interior File These instructions are for paperbacks or ebooks that are supposed to be a duplicate of paperback copies. (Note: This is not for getting a document ready for Kindle or for
More informationIntroduction... 3 Introduction... 4
User Manual Contents Introduction... 3 Introduction... 4 Placing an Order... 5 Overview of the Order Sheet... 6 Ordering Items... 9 Customising your Orders... 11 Previewing and Submitting your Basket...
More informationI made a 5 minute introductory video screencast. Go ahead and watch it. Copyright(c) 2011 by Steven Shank
Introduction to KeePass What is KeePass? KeePass is a safe place for all your usernames, passwords, software licenses, confirmations from vendors and even credit card information. Why Use a Password Safe?
More informationInteractive Tourist Map
Adobe Edge Animate Tutorial Mouse Events Interactive Tourist Map Lesson 1 Set up your project This lesson aims to teach you how to: Import images Set up the stage Place and size images Draw shapes Make
More informationWhat can we do with Processing? Let s check. Natural Language and Dialogue Systems Lab Guest Image. Remember how colors work.
MIDTERM REVIEW: THURSDAY I KNOW WHAT I WANT TO REVIEW. BUT ALSO I WOULD LIKE YOU TO TELL ME WHAT YOU MOST NEED TO GO OVER FOR MIDTERM. BY EMAIL AFTER TODAY S CLASS. What can we do with Processing? Let
More information1. Introduction EE108A. Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game
EE108A Lab 1: Combinational Logic: Extension of the Tic Tac Toe Game 1. Introduction Objective This lab is designed to familiarize you with the process of designing, verifying, and implementing a combinational
More informationCOMP : Practical 8 ActionScript II: The If statement and Variables
COMP126-2006: Practical 8 ActionScript II: The If statement and Variables The goal of this practical is to introduce the ActionScript if statement and variables. If statements allow us to write scripts
More informationCONDITION CONTROLLED LOOPS. Introduction to Programming - Python
CONDITION CONTROLLED LOOPS Introduction to Programming - Python Generating Random Numbers Generating a random integer Sometimes you need your program to generate information that isn t available when you
More informationReact. HTML code is made up of tags. In the example below, <head> is an opening tag and </head> is the matching closing tag.
Document Object Model (DOM) HTML code is made up of tags. In the example below, is an opening tag and is the matching closing tag. hello The tags have a tree-like
More informationVARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.
Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer
More informationUsing Microsoft Word. Tables
Using Microsoft Word are a useful way of arranging information on a page. In their simplest form, tables can be used to place information in lists. More complex tables can be used to arrange graphics on
More informationSNOWFLAKES PHOTO BORDER - PHOTOSHOP CS6 / CC
Photo Effects: Snowflakes Photo Border (Photoshop CS6 / CC) SNOWFLAKES PHOTO BORDER - PHOTOSHOP CS6 / CC In this Photoshop tutorial, we ll learn how to create a simple and fun snowflakes photo border,
More informationLecture 05 I/O statements Printf, Scanf Simple statements, Compound statements
Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple
More informationUsing Flash Animation Basics
Using Flash Contents Using Flash... 1 Animation Basics... 1 Exercise 1. Creating a Symbol... 2 Exercise 2. Working with Layers... 4 Exercise 3. Using the Timeline... 6 Exercise 4. Previewing an animation...
More informationExercise 1 Using Boolean variables, incorporating JavaScript code into your HTML webpage and using the document object
CS1046 Lab 5 Timing: This lab should take you approximately 2 hours. Objectives: By the end of this lab you should be able to: Recognize a Boolean variable and identify the two values it can take Calculate
More informationBarchard Introduction to SPSS Marks
Barchard Introduction to SPSS 21.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data
More information