# Bananas!

--Originally published at Programming course

So this assignment was longer than I expected but it was fun

here is what we had to do:

Write a function called find_bananas which receives a single parameter called filename (a string) and returns a positive integer which is the number of times the word (string) “banana”  (or “BANANA” ) is found in the file. The banana can be any case (‘BaNana’ or ‘BANANA’ or ‘banana’, etc) and they can be “stuck together” like “banAnaBANANA” (that counts as two). Create your own test file (plain text) to check your work.

And my code

# Babylonians

--Originally published at Programming course

So this was the assignment:

The function should receive a number and return floating point number. Obviously you should test your function, so create a main program that asks the user a value, calculates the square root and displays that.

And it was really simple after hearing Ken’s explanation and this article

# WSQ09

--Originally published at Programming course

So this is what Ken told us to do:

So for this assignment I would like to see you create a function that receives as parameter the name of a file (this would be a string value like data.txt) and your function counts the number of lines and the number of characters in the file which it returns as a single value (but with two values). You will want to look at how to create/define and return a struct value from a function and how to open and read text files line by line

This is my code

And this is the help I used from a guy on Youtube:

# Yo soy 196

--Originally published at Programming course

This was the hardest WSQ I made, so basically I asked the user for an upper and under bound and then analyze using Lychrel numbers

# WSQ’s a bit late

--Originally published at Programming course

So i forgot to upload my blog posts but here are all the WSQ’s we’ve done so far

The fifth one we made it’s called “On to functions”, in which basically we have to ask the user for one number and give them integers, here is the code.

I used this link that helped me understand more the for loops.

# Fibonacci series- quiz week 8

--Originally published at Programming course

In this assignment we saw the number series of Fibonacci, which is basically a mathematical explanation to many things in nature, such as the spirals found in flowers, plants, etc, and the numerical sequence in them.  In the program we made, using a loop I told the user the series. This is the code I used.

And if you want to know more about Fibonacci in art, you can click here and there is a great  easy slideshow.

Pictures used:

https://www.flickr.com/photos/snlsn/

http://www.imagekind.com/Hokusai-Meets-Fibonacci-Golden-Ratio_art?IMID=87c29c1e-7700-45a0-ae29-6b7ddcbf7e48

# Quiz 06 part3

--Originally published at Programming course

In this part of the quiz we had to create a program where it had to print out a kind of triangle. The only thing I did was to use a “cout” per line, using the  spaces needed. And that was it

# Quiz 06 part 1

--Originally published at Programming course

So the problem said that we should write this code:

```#include
main()
{ /* PROGRAM TO PRINT OUT SPACE RESERVED FOR VARIABLES */
char c;
short s;
int i;
unsigned int ui;
unsigned long int ul;
float f;
double d;
long double ld;
cout << endl
<< "The storage space for each variable type is:"
<< endl;
cout << endl << "char: \t\t\t%d bits",sizeof(c)*8;  //  \t means tab
cout << endl << "short: \t\t\t%d bits",sizeof(s)*8;
cout << endl << "int: \t\t\t%d bits",sizeof(i)*8;
cout << endl << "unsigned int: \t\t%d bits",sizeof(ui)*8;
cout << endl << "unsigned long int: \t%d bits",sizeof(ul)*8;
cout << endl << "float: \t\t\t%d bits",sizeof(f)*8;
cout << endl << "double: \t\t%d bits",sizeof(d)*8;
cout << endl << "long double: \t\t%d bits",sizeof(ld)*8;
}

```

And then just run it. It was easy because it was just adding stuff like an “int” before the “main()”. The problem began with the couts , but all I had to do was to erase the “%” and the “d” in every line and that was it.

# WSQ04- Sum of numbers

--Originally published at Programming course

In this program (the last one in the first partial ) I had to ask the user for two numbers a lower and an upper bound, so I could sum the numbers between them.

I didn’t know how to do it so this blog helped me a lot (THANK YOU!)

Here is my code

# WSQ03-Pick a Number

--Originally published at Programming course

In this program we had to make a random number and the user needed to guess it. If the number was to high or low, the program will tell.

First I made the random number called nu1.

Then I asked the user to guess and using if, I told the user if the number was higher or lower than the random one and made them choose again.

When they guessed the correct number I asked if they wanted to play again and that was it