WSQ 13

This was quite easy, the thing is that now we had time to look how to do the code and not the pressure of the examn on our backs. Here it goes:

Question 1

exam2-1code

The exe:

exam2-1exe

Question 2 Code

exam2-2 code.png

Exe

exam2-2 exe

Question 3 code

exam2-3 code

Exe

exam2-3 exe

Question 4 code

exam2-4 code

Exe

exam2-4 exe

Here are my codes.

LATER!

 

Exam2 WSQ13

Well kind of late but here are my codes from the partial exam,  I will leave links for my codes in Github, hopefully you’ll find useful.

  1. Write a function called triangles which receives a single parameter (int) which represents the size of a triangle. The function should print a triangle using loops (for or while). The only characters printed here are ‘T’ and the new-line character. The first line is length one, the middle line is length size and the last line is length one. Link to GitHub

Captura de pantalla 2016-04-27 a las 9.54.41 p.m..png

  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 a^b. Link to GitHub

    Captura de pantalla 2016-04-27 a las 9.59.14 p.m..png 

  2. Write a function called fibonacci which receives a long “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) would 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 are the sum of the previous two fibonacci numbers. Link to GitHub

    Captura de pantalla 2016-04-27 a las 10.02.25 p.m..png

  1. Write a function called isPalindrome which receives a string “x” and returns true if the string x is a palindrome, otherwise false. Lint to GitHub

    Captura de pantalla 2016-04-27 a las 10.04.27 p.m..png

WSQ13

DISTANCIA
https://github.com/carbajal13itesm/Fundamentos-/blob/master/distancia%20WSQ13

TRIANGULO
https://github.com/carbajal13itesm/Fundamentos-/blob/master/triangulo%20WSQ13

SUPERPOWER
https://github.com/carbajal13itesm/Fundamentos-/blob/master/superpower%20WSQ13

FIBUNACCI
https://github.com/carbajal13itesm/Fundamentos-/blob/master/fibunacci%20WSQ13

EXAAAAAAM!!!!

Welcome back to my blog!

Today I’m going to show you my second partial exam of my course. It was not a very hard exam and I’m proud of my work in it.

Lets start!

The exam said that we need to write four differents codes and these are the instructions for each code:

  1.  Write a function called triangles which receives a single parameter (int) which represents the size of a triangle as explained below. The function should print a triangle using loops (for or while). The only characters printed here are ‘T’ and the new-line character. The first line is length one, the middle line is length size and the last line is length one.

    The example below is for size 6:

    tes

Here’s my code:

2016-04-15 (1)

tes1

NEEEEEXT!

2. 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 a b So, superpower(3,4) would return 81.

long superpower(long a, long b){

}

Here’s the code:

2016-04-15 (3)

tes12

NEEEEXT!

3. NOTE: for full 5 points, use a loop (not recursion). Write a function called fibonacci which receives a long “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) would 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 are the sum of the previous two fibonacci numbers.

Here’s my code:

2016-04-15 (5).png

tes123

THE LAST ONE!!

4. . Write a function called isPalindrome which receives a string “x” and returns true if the string x is a palindrome, otherwise false.

I had problems creating this one but yet at home I complete it and here is:

 

2016-04-15 (8).png

tes1231

Continue reading “EXAAAAAAM!!!!”

Exam2 WSQ13

Photograph credit

Hey guys, in this blog, well actually this tutorial I’m gonna explain just one of the ways that you can do the programs for our second partial exam with ken. The video is pretty long so I included in the video description the time at which I start explaining each program.

q1.cpp 0:38        q2.cpp 6:00        q3.cpp 10:00       q4.cpp 16:20

Here is the code for each one:

q1.cpp

q2.cpp

q3.cpp

q4.cpp

And of course here is the video tutorial, enjoy (I hope).

made by: Orlando Lara

#WSQ13 #TC101