This lesson is an introduction to recursion. [Computer Programming playlist: 12 of 23]
- Subject:
- Computer Science
- Material Type:
- Lecture
- Provider:
- Khan Academy
- Provider Set:
- Khan Academy
- Author:
- Khan, Salman
- Date Added:
- 10/10/2017
This lesson is an introduction to recursion. [Computer Programming playlist: 12 of 23]
This lesson shows how to use recursion to write a Fibonacci function. [Computer Programming playlist: 17 of 23]
This lesson explains simplifying the 'while look' for the Insertion Sort function. [Computer Programming playlist: 23 of 23]
This lesson clarifies what \break\ does and stepping through the insertion sort implementation. [Computer Programming playlist: 22 of 23]
In this lesson you will understand how the iterative Fibonacci function works for a particular example. [Computer Programming playlist: 16 of 23]
This lesson shows why and how the recursive Fibonacci function works. [Computer Programming playlist: 18 of 23]
This lesson shows what happens when a user inputs a particular value into a factorial program in Python. [Computer Programming playlist: 7 of 23]
This computer programming lesson shows how 'while loop' can do the same thing as 'for loop' in Python. [Computer Programming playlist: 4 of 23]
This lesson demonstrates how to write a simple factorial program with a \for\ loop in Python. [Computer Programming playlist: 6 of 23]
Students gain a deeper understanding of how sound sensors work through a hands-on design challenge involving LEGO MINDSTORMS(TM) NXT taskbots and sound sensors. Student groups each program a robot computer to use to the sound of hand claps to control the robot's movement. They learn programming skills and logic design in parallel. They experience how robots can take sensor input and use it to make decisions to move and turn, similar to the human sense of hearing. A PowerPoint® presentation and pre/post quizzes are provided.
From the Scratch Wiki:
"Scratch contains the resources available for creating a question/answer system. This system can be used for one to be 'quizzed', or to repetitively answer automated questions. This tutorial shows various methods on how to create a question system. For each method, the ask () and wait block is used to ask questions and input answers."
Use these blocks to teach students to create a quiz for many different concepts and disciplines.
This class introduces studies in the algorithmic manipulation of type as word, symbol, and form. Problems covered will include semantic filtering, inherently unstable letterforms, and spoken letters. The history and traditions of typography, and their entry into the digital age, will be studied. Weekly problem sets using Java will explore new ways of looking at and manipulating type.
Testing is critical to any design, whether the creation of new software or a bridge across a wide river. Despite risking the quality of the design, the testing stage is often hurried in order to get products to market. In this lesson, students focus on the testing phase of the software/systems design process. They start by exploring existing examples of program testing using the CodingBat website, which contains a series of problems and challenges that students solve using the Java programming language. Working in teams, students practice writing test cases for other groups' code, and then write test cases for a program before writing the program itself.
Students' understanding of how robotic ultrasonic sensors work is reinforced in a design challenge involving LEGO MINDSTORMS(TM) NXT robots and ultrasonic sensors. Student groups program their robots to move freely without bumping into obstacles (toy LEGO people). They practice and learn programming skills and logic design in parallel. They see how robots take input from ultrasonic sensors and use it to make decisions to move, resulting in behavior similar to the human sense of sight but through the use of sound sensors, more like echolocation. Students design-test-redesign-retest to achieve successful programs. A PowerPoint® presentation and pre/post quizzes are provided.
Using the LEGO® NXT robotics kit, students construct and program robots to illustrate and explore the Fibonacci sequence. Within teams, students are assigned roles: group leader, chassis builder, arm builder, chief programmer, and Fibonacci verifier. By designing a robot that moves based on the Fibonacci sequence of numbers, they can better visualize how quickly the numbers in the sequence grow. To program the robot to move according to these numbers, students break down the sequence into simple algebraic equations so that the computer can understand the Fibonacci sequence.
Students' understanding of how robotic light sensors work is reinforced in a design challenge involving LEGO MINDSTORMS(TM) NXT robots and light sensors. Working in pairs, students program LEGO robots to follow a flashlight as its light beam moves around. Students practice and learn programming skills and logic design in parallel. They see how robots take input from light sensors and use it to make decisions to move, similar to the human sense of sight. Students also see how they perform the steps of the engineering design process in the course of designing and testing to achieve a successful program. A PowerPoint® presentation and pre/post quizzes are provided.
This project was created for use in AP-CSA at Baraboo High School after about a month of learning FuP, Fundamentals of Programming. Below is a list of recommended skills prior to attempting this project. Boilerplate and Scanner code are provided. Students are not taught how to code within the directions of this project. This project provides students an opportunity to apply and practice what they have already learned. Instructions are provided with steps suggested to complete this project.
Repl.it is an online Java IDE ideal for classrooms as it’s free and works within a browser, even on low powered Chromebooks. Creating a Repl allows embedding a working console executing Java code on a website. This is impressive for the senior exit portfolio as many projects created in AP-CSA are complex and abstract and hard to demonstrate to the general public.
Google Sites will be the platform used to publish this project. Detailed step by step instructions on how to embed a Repl onto a website is provided. Google Sites can be created for free by creating a Google Account.
Coding Experience Recommended for this project:
Boilerplate Code
System.out.print()
Variables
Conditionals and Booleans
Iteration (especially while loops)
Coding Experience Suggested for this project:
Scanner (Scanner code provided)
String Handling
Google Sites (Detailed instructions provided)
Students learn how to program using loops and switches. They see how loops enable us to easily and efficiently tell a computer to keep repeating an operation. They also see that switches permit programs to follow different instructions based on whether or not preconditions are fulfilled. Using the LEGO MINDSTORMS(TM) NXT robots, sensors and software, student pairs perform three mini programming activities using loops and switches individually, and then combined. With practice, they incorporate these tools into their programming skill sets in preparation for the associated activity. A PowerPoint® presentation, pre/post quizzes and worksheet are provided.
Building on the programming basics learned so far in the unit, students next learn how to program using sensors rather than by specifying exact durations. They start with an examination of algorithms and move to an understanding of conditional commands (until, then), which require the use of wait blocks. Working with the LEGO MINDSTORMS(TM) NXT robots and software, they learn about wait blocks and how to use them in conjunction with move blocks set with unlimited duration. To help with comprehension and prepare them for the associated activity programming challenges, volunteer students act out a maze demo and student groups conclude by programming LEGO robots to navigate a simple maze using wait block programming. A PowerPoint® presentation, a worksheet and pre/post quizzes are provided.
Students learn about how sound sensors work, reinforcing their similarities to the human sense of hearing. They look at the hearing process sound waves converted to electrical signals sent to the brain through human ear anatomy as well as sound sensors. A mini-activity, which uses LEGO MINDSTORMS(TM) NXT intelligent bricks and sound sensors gives students a chance to experiment with the sound sensors in preparation for the associated activity involving the sound sensors and taskbots. A PowerPoint® presentation explains stimulus-to-response pathways, sensor fundamentals, the unit of decibels, and details about the LEGO sound sensor, including how readings are displayed and its three modes of programming sound input. Students take pre/post quizzes and watch a short online video. This lesson and its associated activity enable students to appreciate how robots can take sensor input and use it to make decisions to via programming.