#WSQ10(Video)What the heck

Now this is more confusing, we must combine loops, functions, mathematical formulas, a few of all the topics we´ve seen until now.

tumblr_nn0zrg89NJ1sszkwto1_540.png

This code will be completely different to the ones you´ve done before(talking abt myself) well, here´s the code posted on GitHub.

To beggin, add the usual library <iostream> and instead of using the “using namespace std” just determinate which of the parameters of the library you´ll use. Also add the <cmath> library because you must use it for the StandartDeviation part of the code.

The program must ask the user for 10 float values, counting and saving them using a variable in function of another, numbers[i]. Repeting the “for” loop as many times as you give the instructions to the program in the NUMOFNUM variable.

Now what? Well the code must have 3 functions(3 + the main) one, which will calculate the total addition of the numbers the users gave. Secondly, the average of the 10 numbers the user typed and finally, the standart deviation(I´ll explain a lot better in the video bellow what is it and how to get it).

Create the function for the total and in it, the program must do a loop to be adding the next value and to not write everything like(number[1]+number[2]+number[3]…etc.

total

In the next one, the average, you don´t have to add the numbers again, just call the last function and just divide it for the number of values(in this case 10) and there you go, you got the average. As you can see in this part of the code you don´t need to create a new loop, using the result of the addition function is all.

averag.png

Now the third part, the standart deviation(yeah i know, you don´t even know what the heck that means haha me either so i had

28eab7e10b01875cf06fa63ca434e055
stdev_s

Continue reading “#WSQ10(Video)What the heck”

#Quiz03(finally!) VIDEO

This was the most difficult program i´ve done since i started coding. The first one was extremely easy but the fibonacci´s got me like

24

Well lets check the codes here´re both of my codes

1st Program: Create a code that calculates the distance between two point in the cartesian plane.

Easy one, the user must type the coordenates of the two points(giving the x and y values of both of them) and using the pythagorean theorem getting the addition of the squares of the differences between x1-x2 and y1-y2. Well here´s a ss of the code and how it works

dist

Dont forget to add the cmath library to use the square root.

2nd Program Fibonacci´s(wth)

Now we´re talking about serious stuff, doing this code was extremely difficult i was breaking my head because i was trying doing it with loops(and there must be a freaking way and later ill figure it out!) then i found the formula

image62

Anddd this helped a lot, to understand better the formula and the proccess. Friday in class me and AlexFoo found a website that explain the fibonacci(and the code) incredibly well. Here´s the page m8s

Let´s check a quick video made by me, explaining the code and some of the fibonaccis uses.

Hope that the video may helped you a little bit, if you have a doubt don´t hesitate to contact me in Fb (Darío Magaña) Twitter @dariosneijder or in my cellphone 3521252322.

I want to take advantage of this post letting you here my Tumblr account, i´m always posting interesting stuff about everything and some amazing pics and thoughts just like this one:

 

#WSQ09 Factorial Video Explanation

Here´s the code, copy it if you want to

Don´t forget the main part of the code, the use of a counter and the condition of the loop, is the most important thing, if you still don´t know how to use loops or what are the loops i recommend you this video, it actually helped me a lot to figure out the logic of the loops.

Check my explanation(in spanish for this time) about how my code works and with it you can check if you have any mistakes or something weird on your code.

Im anxious about doing more WSQ´s, programming is turning one of my fav hobbies.

tumblr_n6xlhdPNxz1rxzj6uo1_500.jpg

#WSQ07 Sum of numbers

Check my code m8s

Second time using loops in C++, not exactly like C# but we´re using almost the same logical rules. I made a video so check it out d:

And thanks to it now i know that my mic is crashed and i didnt know it 🙁

Well ill explain here what the audio of the video couldnt.

I was checking other #wsq posts and many of them give 54 as a result of the sum from 1 to 10 and it should be 55. It means that they´re leaving the first number of the addition out of it and it shouldnt be this way(i already commented of my m8s blogs to let them now their mistake) so to fix this, i´ve added an extra variable that for me is completely functional for the loops, the “i” using it to determinate when the loop should end. I definetely recommend it!

 

 

FlippledLearning #WSQ04

My experience during this course wasn´t very long, thats why i didnt do this WSQ a couple weeks ago, but by now, while i´m working on the 7th-8th and 9th WSQ, and see myself learning with no pressure, at my own rhythm, gave me a clear point of view of the Flipped Learning or classroom theme. I´m trusting a lot in this course, ´cause is different, today, i received the result of my first-half partial math exam, it was a total mess, i´ve had a failure like that, i got 13 point of a hundred, that never happened to me before. What i´m trying to prove here, is that with that grade, i still can pass the subject, but the max i can get is a 90 and that´s if i get all my future stuff perfect. So i decided to delete/erase Math for this semester, im feeling awful, just like i´ve just killed someone, and idk why, i failed an exam, and the traditional learning method have shown us that only the worst students failed. But i know im not a regular student, i know i,m on my way to success and ill make something big in my future, and thats the main reason i dont trust the tradicional teaching methods, ´cause a grade doesn´t define what im im.

I´m totally giving an opportunity to this course, we need to change the way the schools are teaching, and maybe this one is the right one.

I also recommend this video that explain a little bit more about Flipped Classroom new ideas.

#WSQ06 Random Number

This is getting interesting, adding other libraries(if you know which are the right ones) is a very useful tool, in this case, we use the <cstdlib> and the <ctime>

Here´s my code and here how it looks:

rand

My friend Alex helped me telling me which libraries i had to add, check his blog if you want to, he´s one step above me at this moment.

Doing my research i found that many tutorials or users are still using .h libraries.

Just a problem, i still don´t know why we had to write the random number function in base of the time, ill figure it out later.

I run the program and vuala

rand1

Doing this post was very important, why? because it involve loops, which are very helpul in almost all the codes we´re going to do.

Quiz1 first program remake using other libraries

Doing the Quiz instead of including another library for the PI value, i declared it as a float value, i had the doubt so i found the <cmath> library, in which you only have to write M_PI to show or use the PI value.

So i tried it in the Volume of a Cylinder program and it worked, in was easier than what i though.

Some post like this were using the <math.h> library but Ken told us to not use .h libraries so a friend told me about <cmath>.

Here´s how the program structure looks like:

pi

#QUIZ01 When u were only missing a bracket

Today we had the first quiz of the course, the challenge was to create 3 programs, using what we´ve learned since we started the lessons.

The first code calculates the volume of a cylinder, asking the user for the value of the radius and the height, declaring the values as a float data. (Clic on the link for more information) and here´s a screenshot of how it looks like working out.

prog1.jpg

I know there´re some libraries we could´ve used but i didnt know which one to choose and how to use i just know is something like M_PI and the library´s name is math.h or something like that, I´ll search more information about it so next time i wont need to write the PI value.

The second one was similar to the one we did two weeks ago, asking the user to type two numbers and showing the product, division and remainder of them.(I changed the Cygwin background color and it look nice haha)

2

And the last one is almost the same as the 2nd but we had to declare the variables as a float data, so the program could show decimals i the answers. It also shows the addition and the subtraction of the two numbers.

This self-learning course is helping me a lot, with no pressure of doing homeworks and with my own resources. If it wasn´t i could not do activities like this.