1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Programming in C++ Help!

Discussion in 'Software Development' started by Rhino24, Feb 10, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. Rhino24

    Rhino24 Thread Starter

    Joined:
    Feb 8, 2008
    Messages:
    41
    Hello, I have a project and I just need some help getting on the right track. Is there anyone out there that can get me started on the right foot. O.K and the problems goes like this; I have to write equivalent expressions for each of the following, then write a program to show that the original expression and the new expression in each case are equivalent:

    a) ! ( x < 5 ) && ! ( y >= 7 )
    b) ! ( a == b ) || ! ( g != 5 )
    c) ! ( x <= 8 ) && ( y > 4 )
    d) ! ( i > 4 ) || ( j <= 6 )

    Can anyone HELP me out Please!!

    Thanks
     
  2. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    Hi Rhino24,

    Let's see now:
    a) states: ! ( x < 5 ) && ! ( y >= 7 ) which means ( x >= 5 && y < 7 )
    b) states: ! ( a == b ) || ! ( g != 5 ) which means ( a != b) || ( g == 5)
    c) states: ! ( x <= 8 ) && ( y > 4 ) which means ( x > 8) && ( y > 4 )
    d) states: ! ( i > 4 ) || ( j <= 6 ) which means ( i <= 4) || ( j <= 6)

    I would assume a program to demonstrate the equivalences would be to assign differenent values to each of the variables and then compute the equivalent expressions separately and then compare whether they are equal or not and print either "equal" if they are, and "not equal" if they are not - all in C++, I assume.

    -- Tom
     
  3. Rhino24

    Rhino24 Thread Starter

    Joined:
    Feb 8, 2008
    Messages:
    41
    Can you maybe write that down in a source code so I can understand it better? Thanks for the input!
     
  4. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    That is your task, not mine!

    -- Tom
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/681555

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice