2014-10-27 HW18

posted Oct 27, 2014, 1:41 PM by Samuel Konstantinovich   [ updated Oct 27, 2014, 4:28 PM ]
Complete the lab:
//HW 18: Print your 
//1.heading
//2. function definition
//3. Test your program on these values:
(longestHail 100)
(longestHail 200)
(longestHail 1000)
//4. Print the results of those test cases.


//You should have these from class, and can post solutions freely on piazza.
(nextHail n)
(makeHail n)


//You should have started this in class.
(longestHail n) - return the length of the hailstone sequence with the most elements from 1-n.

//Test with different values:
(longestHail 1) -> 1
(longestHail 2) -> 2
(longestHail 3) -> 8
(longestHail 4) -> 8
(longestHail 5) -> 8
(longestHail 5) -> 9
(longestHail 7) -> 17
(longestHail 9) -> 20
(longestHail 11) -> 20







Comments