Goal: Practice gathering multiple pieces of information from corresponding sets of checkbox forms.
Similar to the site depicted in the previous lesson, create a website that prompts users to fill out a survey regarding which methods of transportation they've used to get to work in the past year. Include at least five options for users to select from.
Then, once you can successfully gather data from one question, include a second survey question asking users which methods of transportation they've used to travel to non-work or recreational activities. This second question should use a second set of checkboxes.
Next, create a personality quiz that contains several questions that use checkboxes to select answers. Each question should instruct users to "Check all that apply".
A factorial is an operator that multiplies a number by all of the positive integers less than that number. For example, 5! = 5 * 4 * 3 * 2 * 1 = 120.
By definition, 0! = 1.
Make a web page to compute factorials. Do it without recursion, and then try it with recursion if you're up for a challenge. (Look online for info on recursion.)
A palindrome is any word, phrase, number, or other sequence of characters which reads the same backward or forward. Create a web page to identify whether or not a word is a palindrome.
Bonus points: Make your code check a string of words. For example: "Hello olleH" is a palindrome by our definition.
Given a number, write a method that returns all of the prime numbers less than that number.
This is a tricky problem, and I want you to use the Sieve of Eratosthenes to solve it. Here's how the Sieve of Eratosthenes works to find a number up to a given
primeequal 2, the first prime number.
prime, remove all multiples of
primefrom the list.
number, all the remaining numbers in the list are primes.
You also might find this video helpful in explaining the Sieve.
Lesson 21 of 34
Last updated October 12, 2020