My question is:


** (De Morgans law) , De Morgans law can sometimes make it more convinient for us to express a logical ex-pression. These laws state that the ex-pression ! (condition 1 && condition 2) is logically equivalent to the ex-pression (!condition 1 || ! condition 2). Also the ex-pression !(condition 1 && condition 2) is equivalent to the ex-pression (!condition1 && !condition 2).Use De Morgans law to write equivalent ex-pressions for each of the following , and then write a program to show that the orginal ex-pression and the new ex-pression are equivalent in each case:


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


Can anyone post me the answer for this.

it will be real help for me .
thanks.

Recommended Answers

All 3 Replies

Would it be correct to say that you are asking us to answer your homework?

>>Would it be correct to say that you are asking us to answer your homework? <<
I think tha would be a fair assumption. Seems to me like the kind of request that gets students spelled very often.

That looks like a fun assignment though. It also looks like a full day of work.

Good luck.

Well demorgans law just states that you can make a new statement by using and instead of or and its the same thing. Let me take this example:

!(x<5) && !(y>=7)

That would be equal to (!(x<5)|| !(y>=7))
A program that proves that could be

import java.util.Scanner


Scanner keyboard = new Scanner(System.in);
system.out.println("Give me an X value");
int x = keyboard.nextInt();
system.out.println("Give me a y value");
int y = keyboard.nextInt();
if (!(x<5)|| !(y>=7))
{
system.out.println("The first statement is true");
else
   {
    system.out.println("The first statement is false");
   }
}

if (!(x<5) && !(y>=7))
{
system.out.println("The second statement is true");
else
   {
    system.out.println("The second statement is false");
   }
}

your homeworks probably past due but I hope this helps for the future!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.