Question

Question 1 while loops can be used to implement counter-controlled repetition and while loops can be...

Question 1

while loops can be used to implement counter-controlled repetition and while loops can be used to implement sentinel-controlled repetition. T/F

Question 2

Java does not require that local variables are initialized when declared, but does require that they are initialized prior to use in an expression. T/F

Question 3

Select only those options corresponding to Java's primitive types from the list below

wide

short

float

bit

boolean

byte

String

char

double

int

long

word

points

Question 4 . The following two statements are functionally equivalent (will achieve the same result): T/F

++var;

var++;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. True, while loop is similar to for loop, counter can be implemented using while loop too.

2. False, local variable has default values, eg int has default value as 0

3.
short
float
boolean
char
int
long

4. False, ++var will first increase the value and then do the operation, vice versa with var++

Add a comment
Know the answer?
Add Answer to:
Question 1 while loops can be used to implement counter-controlled repetition and while loops can be...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C -...

    Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...

  • /*************************************************** Name: Date: Homework #7 Program name: HexUtilitySOLUTION Program description: Accepts hexadecimal numbers as input. Valid...

    /*************************************************** Name: Date: Homework #7 Program name: HexUtilitySOLUTION Program description: Accepts hexadecimal numbers as input. Valid input examples: F00D, 000a, 1010, FFFF, Goodbye, BYE Enter BYE (case insensitive) to exit the program. ****************************************************/ import java.util.Scanner; public class HexUtilitySOLUTION { public static void main(String[] args) { // Maximum length of input string final byte INPUT_LENGTH = 4; String userInput = ""; // Initialize to null string Scanner input = new Scanner(System.in); // Process the inputs until BYE is entered do {...

  • Discussion questions 1. What is the link between internal marketing and service quality in the ai...

    Discussion questions 1. What is the link between internal marketing and service quality in the airline industry? 2. What internal marketing programmes could British Airways put into place to avoid further internal unrest? What potential is there to extend auch programmes to external partners? 3. What challenges may BA face in implementing an internal marketing programme to deliver value to its customers? (1981)ǐn the context ofbank marketing ths theme has bon pururd by other, nashri oriented towards the identification of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT