# On to Functions

This program is like one in the WSQ03 but this time we have to add functions to each one.

Had a little problems because I didnt know how to add functions but I read in cplusplus.com something about functions and then I look for a youtube video so taht I can make it rigth, below I attacht the links to the cplusplus webpage of functions and the youtube video for your need.

http://www.cplusplus.com/doc/tutorial/functions/

So here I have my Atom for you to see how it looks

Then I show you the terminal page to you to see how the program works

Check my code here on Github.

# WSQ08 – on to the functions

This program should give you the same results as the WSQ03 but using function for each operation.

So basically, I write single functions, to the sum, product, difference, and division operations. Using void instead of int. And this was kind of quickly because I just copy the main code from de WSQ03, and then I started to editing what I needed.

Here’s the link to my GitHub.

WSQ08 – On To Functions

# Wsq03/WSQ08

These activities were about creating a program in which they calculate the division, sum, difference and the division remainder of two given numbers. It didn’t ask you to do it with function but I did anyways and that was asked in WSQ08. Everything is better if you use functions, for this you have to define your variables. To do this activity I had to check how to define a function, and now I know that you can define it with int, float, long, char.

# Using functions

This WSQ was about using the WSQ3 made before but changing it, now using functions for making each calculation.

As I didn´t know how to make functions on c++ I search for it and foun this page that helped my doing this program. (Here).

For each of the operations I needed to use:

int TheOperation (int x, int y)
{int a;
a = x (-/*%) y;
return a; }

And just at the end instead of using:
cout <<“The difference of these two numbers is: “<<resta;  I just added the two numbers. Ex: cout <<“The difference of these two numbers is: “<<resta (number1,number2);

This was made for all the operations.
You can see my program here: funtions. Feel free for using it.

This are some pictures of my program:

# #WSQ08 On to functions.

Hello people! I made a new program about functions, and yes, it’s the same program as the WSQ03, but now using Functions. What is a function on C++? “In C++, a function is a group of statements that is given a name, and which can be called from some point of the program. The most common syntax to define a function is:

`type` is the type of the value returned by the function.
`name` is the identifier by which the function can be called.
`parameters` (as many as needed) ”

(you can find more interesting information here: http://www.cplusplus.com/doc/tutorial/functions/)

And well, that page helps me a lot making my work easier, and as I sayed before, it was a remake of an old program so it was not difficult for me.

Here, the screenshots of my code using functions:

Haga click para ver el pase de diapositivas.

Here the program on Cygwin Terminal:

And that’s all.

The functions help us to make our program clear and more easy to understand. We cant forget that to put the “RETURN” at the end of the function to make it workable.

Hope you like it!

Don’t forget to see my codes on GitHub. Click here to see them.

EdM.

# Functions? …

Photograph credit

Hey there, catching up on some WSQs, this is WSQ08 I believe and in this program we have to do the same as WSQ03 but with a twist. We have to add functions to the program. But what are functions and how do we use them? Well continue with the video to find out.

Ohh! but before that just let me mention my favorite page sources for finding out how to do stuff on c++

http://www.cplusplus.com/doc/tutorial/introduction/

http://www.tutorialspoint.com/cplusplus/cpp_templates.htm

Here is the code, the simple and complex respectively:

Functions.cpp

FunWithNumbers.cpp

# WSQ08 Functions

The functions allow to structure programs in segments of code to perform individual tasks.

In this program I´m going to do the same as in the WSQ03, but using functions.

You have to enter two numbers and the program will calculate:

• 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.

I will leave the code on GitHub, here is the link.

TC101

WSQ08