Ch 02 Quiz 1

  1. Make a list q1 containing the integers 101, 110, 119, 128, 137, 146, 155, 164, 173, 182, 191, 200, 209, 218, and 227.

  2. Write a function q2 that takes in a list of numbers and puts out a list with each of those numbers tripled. Also write a signature for this function.

  3. Write a function q3 that takes in a number top and a list of numbers, and puts out a list of all of the numbers in the list whose squares are less than top. Also write a signature for this function.

     q3 5000 [10..100] == [10..70]
    
  4. The function q4 takes in a list of Float and puts out a Float: the sum of the square roots of all of the numbers in the input list. Write a recursive function, do not use sum.

     q4 [10.0, 20.0, 30.0] = 13.111...
    

Bonus

  1. The function digits returns a list of the base 10 digits of a number in order from least significant (the ones digit) to most significant. Write it.

     digits 5347500 = [0,0,5,7,4,3,5]
    

Mega Bonus

  1. Largest palindrome product. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers.
Last modified August 18, 2023: 2022-2023 End State (7352e87)