Question: I need help with the following assignment in Java. Match the following terms to the definition below. Note that there are more terms than definitions.

I need help with the following assignment in Java.

Match the following terms to the definition below. Note that there are more terms than definitions.

*=

=*

**

(double)

(floating)

0

1

block

box

counter-controlled

if

ifelse

garbage

group

nested

post-fix

pre-fix

sentinel

sequence

set

strongly-typed

weakly-typed

Which term from the above word bank matches each description below?

This value can be used to terminate repetition when the number of iterations is not known in advance

Default value for instance variables of type int, bool, double

Use this type of loop when the number of iterations is known in advance

Statement is used to execute one action when a condition is true and another when that condition is false

Can use this compound operator toshorten: a = a * 2

A language that requires all variables to have a type

x++ is ____ increment

A control statement inside another control statement

Used to make a temporary floating-point copy of its operand

A set of statements contained in a set of { }s

Answer the following questions:

Write 4 different ways to add 1 to the integer variable num

How many times does the following loop execute?

int i = 0;

while (i <= 2)

{

System.out.println("in the loop");

i++;

}

What does the following code output?

int i = 3;

if (i == 2);

System.out.println("in if");

System.out.println("after the if");

How many times does the following loop execute?

int x = 0;

int total = 0;

while (x < 5)

total += x;

x++;

Looking at the following code, what word do you think you should replace xxx with? yyy with?

if (num % 2 == 0)

System.out.prinln("num is xxx");

else

System.out.prinln("num is yyy");

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!