1) KNOW AND REMEMBER EVERYTHING about First Class Objects
Literally you need to know the definition and the example
2) Know how to write a Histogram except this time its for sine function
a)Define a function f, where f returns f(x)
o hell give you the function f(x) to define (this is a little easier than the rest of the problems)
b)Write a function that maps a list to function f. Basically were
c)Write a function that DISPLAYS the sin histogram
d)Write a function that shows exactly HOW to write the histogram
I cant write a SINE function but think of it as two big round hills going down vertically.
For 2b, youre supposed to map a list of numbers to the function f(x) and I guess you can do this with the map function in scheme.
something like, (map (f(list))something like that I think.
Basically once you get to the next question youll use this map function to create a sin function.
3) Know Ruby functions collect, select, and reject (you may have to use them for this problem. youll be writing a function that checks for two prime numbers that make up an even number, its suppose to be a rule. (ie. 4 = 2+ 2, 6 = 2+ 3, or 8 = 3+ 5)
a)write a function prime?(n) where it takes in an argument n and returns true if its prime, else false
b)write a function arrayPrime(n) where it takes in an array and determines if they are prime using the prime?(n) function you previously wrote
c)write a function that takes in a an argument even and returns two prime numbers from it using arrayPrime(n)
d)write a main function that displays the following:
o2 = 1+ 1
o4 = 2+ 2
o6 = 2+ 3
o8 = 3+ 5
o10 = 5+ 5
o12 = 5+ 7
o14 = 3 + 11
o16 = 3+ 13
o18 = 5+ 13
o20 = 7+ 13
o22 = 3+ 19
o24 = 5+ 19
4)Write both a recursive and iterative version of the following:
1+ 1/1!+ 1/2!+ 1/3! + + 1/n!
Its easier than you may think actually. Its essentially the exact same as the final prep except we use (!) instead
5)Know Ruby classes,inheritance, super, and user input. Youll be writing classes that use other classes and may even write a function in one of the classes that gets the input of the user to define instance variables of the object.
Reviews
There are no reviews yet.