Write a function called sumsquares_list which receives a vector of int and returns the sum of the squares of the elementes in the list. For example, if we have a vector with the values x with values [1,2,3,4,5], sumsquares_list(x) would return 55 since 1 + 4 + 9 + 16 + 25 is 55. GitHub … Continue reading #Quiz08 →
Write a function called sumsquares_list which receives a vector of int and returns the sum of the squares of the elementes in the list. For example, if we have a vector with the values x with values [1,2,3,4,5], sumsquares_list(x) would return 55 since 1 + 4 + 9 + 16 + 25 is 55. GitHub … Continue reading #Quiz08 →
Write a function called fibonacci which receives a lon “n” and returns a long which is the value of the nth number in the fibonacci series which is: 0,1,1,2,3,5,8,13,21,34,55,89………. So, fibonacci(0) woud return 0, fibonacci(5) would return 5, fibonacci(8) would return 21. Note that the first two fibonacci numbers are 0 and 1. All others … Continue reading #Quiz07 →
Write a function called fibonacci which receives a lon “n” and returns a long which is the value of the nth number in the fibonacci series which is: 0,1,1,2,3,5,8,13,21,34,55,89………. So, fibonacci(0) woud return 0, fibonacci(5) would return 5, fibonacci(8) would return 21. Note that the first two fibonacci numbers are 0 and 1. All others … Continue reading #Quiz07 →
Quiz time! 1. Write a function called superpower that has two parameters of type long and returns a long which is first parameter raised to the power of the second, which is to say it returns ab So, superpower(3,4) would return 81. long superpower(long a, long b){ } GitHub Code link for answer 1 2. Write a function called … Continue reading #Quiz06 →
Quiz time! 1. Write a function called superpower that has two parameters of type long and returns a long which is first parameter raised to the power of the second, which is to say it returns ab So, superpower(3,4) would return 81. long superpower(long a, long b){ } GitHub Code link for answer 1 2. Write a function called … Continue reading #Quiz06 →
What was the temperature again? We are going to see how well we’ve understood the “if” and “else” conditionals, you know, those pesky words from fifth grade Grammar: First up we have the code. Notice that there is a void type function before the main function. This was used by me in order to see if … Continue reading WSQ05 →
Error 404: not found. Just kidding, this is a redirect page for the fourth WSQ, the “About” page. Since I can’t put tags in the about page, you’ll just see everything from here. Hope it’s not too confusing! WSQ04
What was the temperature again? We are going to see how well we’ve understood the “if” and “else” conditionals, you know, those pesky words from fifth grade Grammar: First up we have the code. Notice that there is a void type function before the main function. This was used by me in order to see if … Continue reading WSQ05 →
We’re now going to have lots of fun with numbers! This is the preamble for functions, so it is a very important task to know what we’re doing here for future works. The code is shown here below, where we defining the variables before the main function, while making the calculations in the main function. … Continue reading WSQ03 →