1. ## Noob Questions.

Hi guys,

I have literally just started programming (yesterday)
as you can probably guess I already have a lot of questions.

Basically I was going through the tutorial and this came up:

A. !( 1 || 0 ) ANSWER: 0
B. !( 1 || 1 && 0 ) ANSWER: 0 (AND is evaluated before OR)
C. !( ( 1 || 0 ) && 0 ) ANSWER: 1 (Parenthesis are useful)

I didn't know how to work them out, so if you could explain that it would be great.
I know (or think) that the ! makes it the opposite of what it is but i'm still getting confused.
As for other things, is there a chart or something you can link me to that has all the definitions for terms like paranthesis and relational operators because i'm getting a bit overwhelmed.

Last thing:

What are some good 'first programs' to make?
I was thinking of making a guess the number game but do you have any suggestions for nice and simple things to make for a beginning programmer?

Thanks,

2. Just like math, do the inner most parenthesis first. Then remove the parenthesis, and resolve what is left:

!( 1 || 0 )

!( 1 || 0 == 1, because it's 1 OR 0, and since the 1 is there, that's true )
!( 1 )
!1 == not one gives us zero, because NOT TRUE gives you false, and NOT FALSE gives you true.

Try working through the rest.

Quzah.

3. Originally Posted by beat
Basically I was going through the tutorial and this came up:
You're in luck - we just had a discussion on this same exact topic only a few days ago (here).

Originally Posted by beat
What are some good 'first programs' to make?
I was thinking of making a guess the number game but do you have any suggestions for nice and simple things to make for a beginning programmer?
That's a good idea. How about:
- A "cash register" where you enter prices, and when you're done, it adds up the cost, includes tax, and prints out the total. For extra fun, you can enter the payment and print out the change.
- Make your own secret code by taking a string, and go character by character in the array to change one letter to another. Then convert it back to normal.
- Hangman is a classic.
[EDIT]
- Find the result of the multiplication of two values, without using multiplication.
- Enter 10 numbers and find (then print) the average.
- Enter 10 numbers and find (then print) the largest and the smallest values.
- Print a numbered menu, ask user to select a value, and validate the value. If the input is not valid, print an error. If it is valid, print a response based on the selected menu option.