Followers 0

# I'm really getting frustrated.

## 206 posts in this topic

I don't think the OP understands a single word of the that 'mini-tutorial' but yea, nice one nonetheless.

Unfortunately I didn't no. That's why I struggle reading "simple" programming fundamental books and tutorials. I just simply don't understand what a function is. I know what a variable is and how to do if else statements.

##### Share on other sites

Hello,

ShellBox, like I mentioned I dont think programming is for you if you dont understand what a function is at this point.

And the rest, this is a 14 page thread. By now....this should be closed/ended/dead.

Did you checkout daniweb?

Like I said, I wont post here anymore but it just keeps popping up on the minispy.

##### Share on other sites

A function is a set of statements, aimed to perform a single thing.

For example, an function to calculate something. If you put the code for a calculation in a function, you can just 'call' this function everywhere you want in your code without having to write all the actual code over and over again every time you need it.

```public int CalculateLoan(int incomePerHour, int hoursWorked)
{
int loan = incomePerHour * hoursWorked;
return loan;
}

```

This EXTREMELY simplified function(or method, whatever you want to call it) needs to 2 variables to work. First, it needs an incomePerHour which is an Integer and a number of hours, also an Integer.

Than it goes to work. It calculates the loan and stores it in a seperate variable 'loan' and then returns loan. The function's work is done here. It took 2 parameters, performed a set of actions on it and returns the result.

The advantage is,every time you need to calculate a loan in your application, you can simply call CalculateLoan and give it the 2 variables it needs

```int myLoan = CalculateLoan(12, 8);

// myLoan will contain 96
```

Now, this is extremely simplified and by no means complete but it just demonstrates the basic concept of a function. You also have functions that don't necessarily return something. They just DO something. You could also write that CalculateLoan function on 1 line instead of 2 (omitting the loan variable) but don't focus on that for now.

Now I'm not a teacher (and maybe it shows :/ ) but I hope it helped.

##### Share on other sites

Unfortunately I didn't no. That's why I struggle reading "simple" programming fundamental books and tutorials. I just simply don't understand what a function is. I know what a variable is and how to do if else statements.

I did state that you need to understand what is a function first. That's why you shouldn't try to learn every concept in any order, and follow a good method like the one I've been recommending in every single post I made in this thread.

1 person likes this

##### Share on other sites

I did state that you need to understand what is a function first. That's why you shouldn't try to learn every concept in any order, and follow a good method like the one I've been recommending in every single post I made in this thread.

A lot of things that has been recommended to me in this thread is something I simply not understand like I have previously stated.

##### Share on other sites

A lot of things that has been recommended to me in this thread is something I simply not understand like I have previously stated.

Then you clearly are not actually reading the replies people give you.

Andre S has repeatedly suggested you look up the Yellow Book.  This book will explain all those basic terms you don't understand.  If you're not going to do as suggested, then give up. You're never going to be able to program if you don't understand the basic concepts, and if you're not going to take people's advise to GET that basic knowledge, what's the point?

Follow the link, download the PDF, and read it.  I've read it myself, it's a VERY good book that gives you all the information you need at the level you need it.  If you're not going to do that, you will never progress in your desire to be a programmer.

2 people like this

## Create an account

Register a new account