Topic: Array
10. Fill an array with random numbers. Display the array. Output the average of all the numbers.
See more
2. Put numbers 15 to 1 in array. Display the number as well as the squared and cubed value.
See more
9. Fill an array of random numbers 1-100 of 25. Sort the array from smallest to largest numbers
See more
28. Fill an array of numbers 1-25. You should have 25 numbers. Shuffle the array (using the function given in class) and display the results.
See more
29. Create an class for a fortune cookie. When you create your object, you will fill the cookie with 7 fortunes in an array. Then in a link, call a function in the object to display a random function. The display should be within an h3 tag using getElementById().
See more
3. Create a loop that rolls a six sided die 50 times. Using an array, count how many times each side is rolled. Display the results.
Variation:
Create a loop that rolls a 20 sided die 500 times. Using an array, count how many times each side is rolled. Display the results.
See more
31. Collect 40 numbers into an array. Using 10 rounds of 4 numbers, complete the following on the 4 numbers. Add the first and second together, then divide by the third and multiple by the fourth. Show each formula with its answer showing like this: (first + second) / third * fourth = answer
See more
33. Fill an array of random numbers 1-2500. You should have 25 numbers. What was the largest number rolled?
See more
34. Create a number guessing name. The random number to guess should be between 1 and 100. Keep all the guesses made in an array. Count the number of guesses. As the user guesses, tell the user if they are too low or are too high.
See more
37. One Line Madlib!
Create an array for 3 stings. Enter in a future tense verb and 2 nouns. Output the collected items in the proper place in the sentence below.
And, now Your Highness, we will (future tense verb) the (noun) of your hidden Rebel (noun).
See more
22. Collect 10 temperatures in an array. Then determine in output if the temps are hot (<90), warm (68-89), cool (67-40), or cold (<39). As part of the output, show the Celsius value as part of the output.
Celsius formula to convert from Fahrenheit:
C = (F - 32) * (5/9)
See more
47. Create a program that accepts information from the user about bugs in the system.
Think of the system as a generic software program and this is an overly simple process to report bugs.
See more
32. One Line Madlib!
Create an array for 3 stings. Enter in 2 nouns and a verb and then output the collected items in the proper place in the sentence below.
I am a (noun) not because I do not have a (noun), but because I (verb) to have many!
See more
49. Create an array for a fortune cookie. When you create your array, you will fill the array with 7 fortunes in an array. Then using a button, display a random fortune from your array.
See more