During this activity, the students will use drag and drop computer code to create an interactive ecological energy pyramid model that shows how the 10% law applies to the energy available at each trophic level. As part of the hour of code, students can use this activity to participate in the Hour of Code week during their biology class.
This lesson plan results from a collaboration between the Alabama State Department of Education and ASTA.
From polygon count and meshes, to lighting and texturing, there are a lot of considerations in building the 3D objects we see in our movies and video games, but then displaying these 3D objects of a 2D surface adds an additional number of challenges. So we’ll talk about some of the reasons you see occasional glitches in your video games as well as the reason a dedicated graphics processing unit, or GPU, was needed to meet the increasing demand for more and more complex graphics.
This video will talk about how HUGE programs with millions of lines of code like Microsoft Office are built. Programs like these are way too complicated for a single person, but instead require teams of programmers using the tools and best practices that form the discipline of Software Engineering. We'll talk about how large programs are typically broken up into function units that are nested into objects known as Object-Oriented Programming, as well as how programmers write and debug their code efficiently, document and share their code with others, and also how code repositories are used to allow programmers to make changes while mitigating risk.
Programming--sometimes referred to as coding--is a nuts and bolts activity for computer scientists. While this chapter won't teach you how to program (we've given some links to sites that can do this in the introduction), we are going to look at what a programming language is, and how computer scientists breathe life into a language. From a programmer's point of view, they type some instructions, and the computer follows them. But how does the computer know what to do? Bear in mind that you might be using one of the many languages such as Python, Java, Scratch, Basic or C#, yet computers only have the hardware to follow instructions in one language: a very simple "machine code" that is difficult for humans to read and write. Then if you invent a new programming language, how do you tell the computer how to use it?
In this chapter, we'll look at what happens when you write and run a program, and how this affects the way that you distribute the program for others to use.
People often become frustrated with computers and other digital devices. At some point when using these devices, you are likely to become annoyed that the system did something you didn't want it to do, or you can't figure out how to get the computer to do what you want, but why is that? Humans made computers, so why are computers often so frustrating for humans to use?
Human-computer interaction (HCI) is about trying to make programs useful, usable, and accessible to humans. It goes way beyond choosing layouts, colors, and fonts for an interface. It's strongly influenced by the psychology of how people interact with digital devices, which means understanding many issues about how people behave, how they perceive things, and how they understand things so that they feel that a system is working to help them and not hinder them. By understanding HCI, developers are more likely to create software that is effective and popular. If you ask people if they have ever been frustrated using a computer system, you’ll probably get a clear message that HCI isn’t always done well.
This chapter explores user interfaces, usability, and overall user experience with technology.
In this lesson, students add variables to two different exemplary apps to keep track of a score or a count of some number of button clicks. The major topic is variable in scope and understanding the differences, benefits, and drawbacks, of using global versus local variables. This lesson focuses more on using global variables since in event-driven apps that’s what you need to keep track of data across multiple events.
The very basics of a simple if statement are also presented in this lesson, mostly to highlight the difference between the = and == operators. Finally, students are asked to apply what they’ve learned about variables, scope, and if statements, to make their own “clicker” game modeled after one of the exemplars they saw during the lesson.
Students will be able to:- use global variables to track numeric data in an app.- give a high-level explanation of what “variable scope” means.- debug problems related to variable scoping issues.- modify existing programs to add and update variables to track information.- create a multi-screen "clicker" game from scratch.
Note: You will need to create a free account on code.org before you can view this resource.
This lesson attempts to walk students through the iterative development process of building an app (basically) from scratch that involves the use of if statements. Following an imaginary conversation between two characters - Alexis and Michael - students follow the problem solving and program design decisions they make for each step of constructing the app. Along the way, they decide when and how to break things down into functions, and of course, discuss the logic necessary to make a simple game.
The last step - writing code that executes an end-of-game condition - students must do on their own. How they decide to use if statements to end the game will require some creativity. The suggested condition - first to score 10 points - is subtly tricky and can be written in many different ways.
At the conclusion of the lesson, there is three practice Create PT-style questions as well as resources explaining the connection between this lesson and the actual Create PT. Depending on how you use these materials they can easily add an additional day to this lesson.
Students will be able to:- write code to implement solutions to problems from pseudocode or description.- follow the iterative development process of a collaboratively created program.- develop and write code for conditional expressions to incorporate into an existing program.- write a large program from scratch when given directions for each step.
This lesson demonstrates how a slight manipulation of a conditional statement can allow for the creation of a new and powerful tool in constructing programs, a while loop. Students are introduced to a while loop by analyzing the flow chart of a conditional statement in which the "true" branch leads back to the original condition. Students design their own flowcharts to represent a real-world situation that could be represented as a while loop, and they learn how to recognize common looping structures, most notably infinite loops. Students then move to App Lab, creating a while loop that runs exactly some predetermined number of times. While learning about creating while loops, students will be introduced to many of the common mistakes early programmers make with while loops and will be asked to debug small programs. They finally progress to putting if statements inside a while loop to count the number of times an event occurs while repeating the same action. This activity will recall the need for counter variables and foreshadows their further use in the following lesson.
Students will be able to:- explain that a while loop continues to run while a boolean condition remains true.- translate a real-life activity with repeated components into a form that could be represented by a while loop.- analyze a while loop to determine if the initial condition will be met, how many times the loop will run, and if the loop will ever terminate.- write programs that use while loops in a variety of contexts.
Note: You will need to create a free account on code.org before you can view this resource.
In this lesson, students gain more practice using while loops as they develop a simulation that repeatedly flips coins until certain conditions are met. The lesson begins with an unplugged activity in which students flip a coin until they get five heads in total, and then again until they get three heads in a row. They will then compete to predict the highest outcome in the class for each statistic. This activity motivates the programming component of the lesson in which students develop a program that allows them to simulate this experiment for higher numbers of heads and longer streaks.
Students will be able to:- use a while loop in a program to repeatedly call a block of code.- use variables, iteration, and conditional logic within a loop to record the results of a repeated process.- identify instances where a simulation might be useful to learn more about real-world phenomena.- develop a simulation of a simple real-world phenomenon.
Students will extend the My Favorite Things app they built in the previous lesson so that it now manages and displays a collection of images and responds to key events. Students are introduced to the practice of refactoring code in order to keep programs consistent and remove redundancies when adding new functionality. As part of learning to use key events, students are shown that event handlers pass a parameter which contains additional information about the event. This lesson also serves as further practice at using arrays in programs.
Students will be able to:- use an array to maintain a collection of data in a program.- create apps that allow user interaction through key events.- refactor code in order to appropriately incorporate new functionality while maintaining readability and consistency.
Students continue to practice working with arrays and are introduced to a new user interface element, the canvas. The canvas includes commands for drawing simple geometric shapes (circles, rectangles, lines) and also triggers mouse and key events like any other user interface element. Over the course of the lesson, students combine these features to make an app that allows a user to draw an image while recording every dot drawn on the canvas in an array. By processing this array in different ways, the app will allow students to redraw their image in different styles, like random, spray paint, and sketching. Along the way, students use their knowledge of functions with return values to make code which is easy to manage and reuse.
Students will be able to:- programmatically control the canvas element in response to user interactions.- maintain a dynamically generated array through the running of a program in order to record and reuse user input.- use nested loops within a program to repeat a command on the same array index multiple times.- perform variable arithmetic within an array index to access items in an array by their relative position.