Thread: Noob Questions.

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    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. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    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.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Quote Originally Posted by beat View Post
    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).

    Quote Originally Posted by beat View Post
    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.
    Last edited by Matticus; 08-04-2011 at 12:40 AM. Reason: Added more simple ideas.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. noob at programming, i have some questions
    By evilyoshi in forum C++ Programming
    Replies: 4
    Last Post: 06-10-2011, 07:04 AM
  2. noob here with questions
    By rllove37 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2010, 03:32 PM
  3. Few more noob questions
    By SlpCtrl in forum C Programming
    Replies: 12
    Last Post: 10-14-2008, 04:32 PM
  4. 2 very noob questions
    By chasingxsuns in forum C Programming
    Replies: 20
    Last Post: 05-07-2006, 11:04 PM
  5. Noob Questions...
    By Firemagic in forum C++ Programming
    Replies: 4
    Last Post: 04-19-2006, 03:57 PM