Solve the following problems(a,b,c).
3. Rewrite each of the following fragments using nested if statements without compound conditions.
a. If (( rate = = 1) && (sum > 1000))
{
x = x + 1;
}
else if ((rate == 1 ) && (sum <= 1000))
{
x = x + 2;
}
else if ((rate == 2) && (sum > 1000))
{
x = x + 3;
}
else if ((rate ==2) && (sum <= 1000))
{
x = x + 5;
}
b. If (((a > 0) && (b > 0)) || (c > 0))
{
System.out.println(" Option one");
}
else
{
System.out.println("Option two");
}
c. If ((a > 0) && (b > 0))
{
System.out.println("Both Positive");
}
else
{
System.out.println ("Some Negative");
}