Category Archives: WSQ’s

Word count WSQ12

Here is my blog post for the WSQ 12.

Create a program that asks the user for a word which will be your search word and the name of a file to open and search for that word. Then create a function that will receive two parameters (both string) representing those two data points. This function returns the number of occurrences of that word in that file. Here is the link to my GitHub.

 

Captura de pantalla 2016-05-04 a las 11.14.45 p.m..png

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

Factorial calculator WSQ09

Hi everyone! I know that i haven’t blog in a while but I’m back!

What to do?

Create a program that asks the user for a non-negative integer (let’s call that number n) and display for them the value of n! (n factorial). After showing them the answer, ask them if they would like to try another number (with a simple y/n response) and either ask again (for y) or quit the program and wish them a nice day (if they answered n).

Well first of all you need to instal some stuff, the big integer library, at least that was my case, here you have de link for the page BigInteger Library.

Also I recommend you to watch Ken’s video about this, this video is for the last semester, but it might help you.

 

Finally this is my link to my GitHub for my code.

Captura de pantalla 2016-04-07 a las 12.33.01 a.m.

Sum of numbers WSQ07

Hello my friends, today we are going to do a task that is very similar to the last ones, but a little more difficult, we are going to write a program that ask the user for a range of integer numbers and then prints the sum of the numbers in that range (inclusive).

We can use a formula but thats not the way that we are going to do it, first we have to decelerate variants, and the use “while” and “if”. Here are some grateful videos for your enjoyment.

 

And as always, the link for my code in GitHub and some evidence

Captura de pantalla 2016-02-12 a las 8.42.59 p.m..png

 

 

Pick a number WSQ06

Hi again!! honestly this task was a little difficult, I had to do some research for this WSQ, and i found some great videos that I leave here. The WSQ consist in creating a program  that ask the user a random number between 1 and 100, the user have to guess and the program won’t stop running until you get the right number, but the machine give you hints and the number of attempts.

 

 

Chis is my link for my code, GitHub.

Captura de pantalla 2016-02-11 a las 10.25.22 p.m.

Temperature WSQ05

Hello!! the task of today was simple, you have to declare variants, also you have to use “if” and “else”, the program will ask you for the temperature in fahrenheit and then the computer will calculate the temperature in celsius with this formula: C = 5 ∗ (F − 32)/9. As an addition of this task, you have to manipulate the code until the computer tell the user if the water boils at the temperature given (under typical conditions), here is an example:

Captura de pantalla 2016-02-10 a las 10.20.39 p.m.

If you don’t know how to use “if” and “else” here are some videos, it might be useful.

 

And finally, this is my code GitHub

Flipped learning WSQ04

wsq04 image 2

Hello my friends!! Today I´m going to talk about a little bit about flipped learning and what I think about it.

First of all, the flipped learning (as the name suggest) is different than the usual method of learning, in the flipped learning method you don’t have pressure and you have to learn by yourself, the pressure is as much as you want, I will leave some videos and links with more information:

http://www.theflippedclassroom.es/what-is-innovacion-educativa/

 

 

In my opinion (and experience) I think is a good method, in fact I think is better than the usual method, but you need to be very responsable, because the teacher won’t teach you, yeah probably the teacher will help when you don’t understand, but the flipped learning is learning by your self, that is ok, I guess.

Fun with numbers WSQ03

Hello everyone!! This WSQ was simple, all about variables, the task is to ask the user for two integer numbers and calculate the following instructions:

  • The difference of the two numbers.
  • The product of the two numbers.
  • The integer based division of the two numbers (so no decimal point). First divided by second.
  • The remainder of integer division of the two numbers.

Captura de pantalla 2016-02-09 a las 1.46.10 p.m.

If you search in youtube or google, you can find various examples about this, most of them are in english, but are very helpful, I will leave some ones here.

This one is in English http://www.lynda.com/C-tutorials/Defining-variables/182674/366529-4.html.

As always, the link for my code in GitHub