# Proyect

For the proyect Christian and I decided to do a program with lots of programs we had been doing along the semester this includes: the simple calculator, the temperature converter, the lucky game, function calculator,  and the factorial calculator. This is our program in case you might need it CODE.

that’s the program working right there, I must give more credit to my coworker, because he did most of it. Please check out his page

# WSQ #12 Word Count

This one was very difficult so I asked my friend Christian for his help, he is going to be a programmer so I thought he could help me figure out what to do; therefore I saw the way he did it in order to do it, I basically do it with him the whole time, because I wasn’t sure how to do it. It was hard :O but I did it finally. Here is the CODE in case you might need it.

Anyways, it was hard, but Christian made it easier, so I thank BatmanTec for coding.

# Quiz #7 The dot number

For this quiz we had to do the Dot number of 2 series of numbers, therefore you needed to create 2 arrays where the numbers were inputed, then the numbers are multiplied. The first of each array then the second, and that way until it’s done; finally you add them and that’s the dot number. Mostly used with Vectors.

But first the program will ask you for how many number you would like in each array.

Here it’s how it works

And here is the code in case you might need it.

# #WSQ11 I am 196

Hey for this one it’s enought to say that I tried as much as I could, but I wasn’t able to complete it so I got lots of help from different post until I found one which was really complex, an decided to use that one with some modification.

And there you have them, here is the code in case you need help with it.

# Quiz #5-2

For quiz number 5-2 we had to do a function where it found the numbers divisible by 3 and add them as an example (0+3+6+9+12), for this one i had help from  Chuy, who first showed me his work and then helped me with mine, until we made it.

find the code here: CODE

# Quiz #5-1

For this quiz first we had to do a function which will turn a word on one side to the other and tell if it was written right on both sides, i had to do research in order to do this one but anyways here it goes

then you ask for the word, and work with the function

and finally if you want all the code find it here: CODE

# Quiz #4

For quiz number 4, here is the problem Ken told us to do.

QUIZ4

Anyways this quiz was not as difficult as I thought it would be, but anyways here is my code in case you might need it.

For this code you should use (long double) instead of (int) in order to get a greater aproximation, due to the number of integers the computer will show.

Here is how the program should be seen on Cygwin when used:

In case you don’t know what #include <iomanip> here is an explanation, basically it’s called Input Output Manipulation

During my first try I had problems with Quiz4, that’s the reason why I had to do it over again, did it twice before I got the working one.

# #WSQ10 LISTS

Well for this WSQ we had to create a list of numbers where the user inputs 10 numbers, and from there you must add them all, get the average, and get the standard deviation. But fiest Mr. Bauer ask us why we uses “namespace std” if we didn’t know what that meant, therefore he showed us that we should use what we know, in this case “include std::cout,cin, endl” so that’s what we did. And he also gave us the first Function we needed for the program.

from the first function we had to imagine how the 2nd and 3rd would look like, I wondererd for so long until I went onto my m8 Dario’s blog, and checked if he had done another function for the average, which was the case, but contrary of what I had thought, he used last function in the new function so he didn’t have to add the numbers again. And for the standard deviation we had to do one Function totally different.

Finally the main was easier that all, you just had to put all the variables on the float, add a constant for the Numbers and say that the number to be inputed would be until it became equal to 10 (i=10) so each time a number would be inputed, the counter would go (i++).

The you just have to print the answers, using the functions with the variables (x, numberofNumbers) and end, between each line.

Here is my code in case you might need it.

# Quiz#3 Part#2

For this second part of the Quiz, we had to do the Fibonacci sequence, where the user gives a number and the Fibonacci sequence will end on the users number. At first I intended to use a Do, While function where we had two counters, one initialized in 0 and another in 1, and each time the loop repeated the counters will add 1 until it reached the number the user placed in.

But after some trying, it didn’t worked, so I called Christian to ask him for help, he told me he hadn’t used any do, or while, and showed me how to do it that way, this time I tryed as he told me and it did work, so I left it how he told me.

My base function was something like this:

int Fib (int cont1, int cont2, int x) {

int x, int cont1==0, int cont2==1

do{

Fib= (cont1+cont2)

while (cont2==x)

Something like that, but it didn’t work, so I changed it to this one. Found HERE

And the process in Cygwin, in which I wanted to know until what number the programm would work without any trouble. I found out that in 50, the numbers came out negative, and by number 300, the computer has not given me an answer yet.

# Quiz #3 Part#1

I had some help from Here, and from the blogpost of some of my classmates, but anyways, this first part was kind of a problem for me because of this…

which actually continues going down, but anyways I couldn’t understand what was wrong with this, until I discovered that I had declared a variable like 3 times. Now this is how the program should look.

Once you get to understand what the program does, it’s not so easy to write it, but the best way to do it is by writting a function for the process, before starting the main program.

Here is the function I used, but the full coding is HERE

float distance (float x1, float  x2, float  y1, float  y2) {
float dis;
dis=sqrt((x2-x1)*(x2-x1)+((y2-y1)*(y2-y1)));
return dis;
}

After declaring the variable (dis) = distance we can ask the user for values for (x1,x2,y1,y2) and writing the formula, in order to get the value “dis=distance(x1,x2,y1,y2);”

First I thought of using “int”, but after looking at someone elses job, I decided to use “float”, even though I think you can also use “double”. I also saw that you can ask for two variables at once by writting (cout<<“…”<<endl; cin>>x>>y).