In order to program, you need to be familiar with some basic algebra concepts even though you don't need to be any decent at math. The following should make sense to you and you should be able to tell me the answer in every situation:
a = 1
b = 2
c = a + b + 1
What is the value of c?
m = 3
n = m - c
What is the value of n?
x = 5
y = x * 2 (where the asterisk is the multiplication symbol)
What is the value of y?
With algebra we are introduced to the concept of variables. A variable, as daunting as it may sound, is simply some 'thing' that contains 'something' else. Above we have several variables: a, b, c, m, n, x, and y and they will store a number. In these examples, these numbers are whole numbers -- oh that's just an observation for now.
Going through this from the top to the bottom we can conclude that:
c = 4
n = -1
and y = 10
But that took brain power to solve. Let's get the computer to perform the calculations.
JavaIn order to create a variable in Java we need to specify what type of 'thing' it is going to contain. One of the types you can use is an Integer or int. An int represents a smaller whole number. You should use it for a variable that you know will never be greater than a trillion. To declare what type a variable is going to be write it before the variable name. If you want the variable "a" to be an "int" you can write it as "int a".
Here's the code and make sure that you save it as SimpleArithmetic.java:
class SimpleArithmetic {
public static void main(String[] args) {
int a = 1;
int b = 2;
int c = a + b + 1;
System.out.println("What is the value of c? " + c);
int m = 3;
int n = m - c;
System.out.println("What is the value of n? " + n);
int x = 5;
int y = x * 2;
System.out.println("What is the value of y? " + y);
}
}

Compile and run the java file and you'll get he desired results.
JavaScriptJavaScript and Python is a little more 'loose' than Java where you don't need to specify the type of your variables. The same code in JavaScript should look very similar to the algebraic expressions. Also, in this example and printing out three "break" tags in order to print the messages on separate lines so I hope that doesn't confuse anyone.
<script type="text/javascript">
a = 1
b = 2
c = a + b + 1
document.write("What is the value of c? " + c)
document.write("<br />");
m = 3
n = m - c
document.write("What is the value of n? " + n)
document.write("<br />");
x = 5
y = x * 2
document.write("What is the value of y? " + y)
document.write("<br />");
</script>

Open up the file in your favorite browser and you'll be greeted with the following:
PythonLike JavaScript, this is a loosly-typed language. You don't have to specify what the type of your variables. In this file, named SimpleArithmetic.py -- BTW unlike Java, Python files aren't coupled to the name of the class -- we can write code that look eerily easy to understand.
a = 1
b = 2
c = a + b + 1
print "What is the value of c? %s" % c
m = 3
n = m - c
print "What is the value of n? %s" % n
x = 5
y = x * 2
print "What is the value of y? %s" % y

Doesn't python look beautiful? Executing the code is easy as pie as well.