Programming in C++ Help!

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

Not open for further replies.
1. 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

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. Can you maybe write that down in a source code so I can understand it better? Thanks for the input!

Joined:
Sep 12, 2003
Messages:
20,583

-- Tom

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.

over 733,556 other people just like you!