Indicate whether the value of each expression is true or false describes a loop.

Part A
Perform the following problems in Exercises, Problems and Projects

Complete 1-3, 39 and 44
⦁ Given the following code declaring and initializing two int variables a and b with respective values 3 and 5, indicate whether the value of each expression is true or false.

Expression true false
a < b ____ ____
a != b ____ ____
a == 4 ____ ____
( b − a )<= 1 ____ ____
Math.abs( a − b ) >= 2 ____ ____
(b % 2 == 1 ) ____ ____
b <= 5 ____ ____
2.   Given the following code declaring and initializing three boolean variables a, b, and c, with respective values true, true, and false, indicate whether the value of each expression is true or false.

Expression true false
!a ____ ____
a && b ____ ____
a && c ____ ____
a || c ____ ____
! ( a || b ) ____ ____
!a||b ____ ____
! ( ! ( a && c ) ) ____ ____
a && ! ( b || c ) ____ ____
3.   Given two boolean variables a and b, are the following expressions equivalent?
! ( !a )
a

39.   You coded the following in class Test.java:

At compile time, you get the following error:

Explain what the problem is and how to fix it.
44. Write a program that calculates the area of the following figures:
a square of side 0.666666667
a rectangle of sides and 4
Test the two calculated areas for equality; discuss your result.

Part B
Perform the following problems in Exercises, Problems and Projects

Complete 1-3, 5, and 8.
1    How do you discover that you have an infinite loop in your code?
The code does not compile.
The code compiles and runs but gives the wrong result.
The code runs forever.
The code compiles, but there is a run-time error.
2    If you want to execute a loop body at least once, what type of loop would you use?
for loop
while loop
do/while loop
none of the above
3    What best describes a for loop?
It is a count-controlled loop.
It is an event-controlled loop.
It is a sentinel-controlled loop.
5.   What is the output of this code sequence? (The user successively enters 3, 5, and −1.)

8.   What are the values of i and sum after this code sequence is executed?

Last Completed Projects

topic title academic level Writer delivered

Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.

Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.

[order_calculator]