Question

Quiz Question 1 (1 point) Saved The maximum value for an int is: Question 1 options:...

Quiz

Question 1 (1 point)

Saved

The maximum value for an int is:

Question 1 options:

2147483647

65535

32767

9223372036854775804

Question 2 (1 point)

A float has ____ decimal places of accuracy.

Question 2 options:

15

none    

7

3

Question 3 (1 point)

It is a good practice to compare floats and doubles with ==.

Question 3 options:

True
False

Question 4 (1 point)

Strings are reference data types.

Question 4 options:

True
False

Question 5 (1 point)

Value data types and references are stored on the stack while objects are stored on the heap.

Question 5 options:

True
False

Question 6 (1 point)

!(a && b) == ________

Question 6 options:

(!a && !b)

(!a || !b)

(a && !b)

(!a || b)

Question 7 (1 point)

What value is stored in num by this code segment?

int a = 6;  

int b = 7;

int num =0;

if(a == b)

num=2;

else

num=-2;

Question 7 options:

0

-1

2

-2

Question 8 (1 point)

Given:

int a = 5;

int b = 7;

Does the following expression evaluate to true or false?

(b > a) && (a + b <a * b)

Question 8 options:

True
False

Question 9 (1 point)

When working with objects, the comparison operator (==) checks to see if the variable (object reference) points to the same object, i.e., the variable stores the same address.

Question 9 options:

True
False

Question 10 (1 point)

Switch statements can use integers, bytes, enumerated types characters and strings as the expression to switch on. switch(expression):

Question 10 options:

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

""""""""""""""""""""""""""""""If any doubt please comment"""""""""""""""""""""""""""""""""""

Q1)

ans) 32767 ( 2 byte)

int is stored in 2 byte and its value ranges from -32,768 to 32,767

Q2)

ans) 7

Fact: Float has 7 decimal digit of precision

Q3)

ans) False

No comparing float and double with (==) is not a good idea as it produce some unexpected error

Q4)

ans) True

A reference type contains a pointer to another memory location that holds the data. Therefore string and array both are reference type.

Q5)

ans) True

The local variable is stored on the stack, while the object itself is stored on the heap: The stack is always used to store the following two things: ... Value-typed local variables and method parameters (structs, as well as integers, bools, chars, DateTimes, etc.)

Q6)

ans) (! a || ! b)

By DeMorgans's law: !(a and b) = !a or ! b

Q7)

ans) d option ( - 2 )

Since a==b is not true therefore else statement will be executed and num will have value -2.

Q8)

ans) True

a=5

b=7

(b > a) && (a + b <a * b)

we can see that (b > a)=true and (a + b <a * b)=true therefore and will return true.

Q9)

ans) True

(==) compares the references. That is, are these two objects located at the same place.

Q10)

ans) True

A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Enum Types), the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer

Add a comment
Know the answer?
Add Answer to:
Quiz Question 1 (1 point) Saved The maximum value for an int is: Question 1 options:...
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 What is the value of x after the following int x = 5; x++;...

    Question 1 What is the value of x after the following int x = 5; x++; x++; x+=x++; A)14 B)10 C)13 D)15 Question 2 The last line in value returning function (before the }) should contain the word return. True False Question 3 This contains three parts: Void or Data Type the name optional parameter list A)Menu System B)Function Header C)Switch Question 4 What is a variable? A)a pointer B)a place in memory to hold data C)int D)a computer programming...

  • Please answer me as soon as possible Quiz Question 1 (1 point) Saved What metric is...

    Please answer me as soon as possible Quiz Question 1 (1 point) Saved What metric is used to measure bandwidth? Question 1 options: a. msec b. bit/sec c. bytes d. number of packets/sec Question 2 (1 point) Saved Ethernet is one of access network technologies. Question 2 options: True False Question 3 (1 point) Saved Consider two hosts, A and B, connected by a single link of rate R bps. Suppose that the two hosts are separated by m meters,...

  • Part Two: Fill in the Blanks and True/False (24 total points - 2 points each) For...

    Part Two: Fill in the Blanks and True/False (24 total points - 2 points each) For each of the following, fill in the most appropriate word(s)phrase/solution in each blank 1) Keywords, identifiers and literals are all kinds of are simply groups of characters that are used for various purposes in a program. , which 2) The Java expression: 11 - 2 + 3 evaluates to 3) List the Java boolean (logical) operators in order from highest priority to lowest priority...

  • Question 1 (1 point) Saved Averages are referred to as measures of central normalcy. Question 1...

    Question 1 (1 point) Saved Averages are referred to as measures of central normalcy. Question 1 options: True False Question 2 (1 point) Saved The value in the middle of a set of ranked data is called the mean. Question 2 options: True False Question 3 (1 point) Saved The piece of data that occurs the most in a set of data is called the median. Question 3 options: True False Question 4 (1 point) Saved Measures of dispersion are...

  • What is the value of  result after the following code executes?   int a = 60; int b...

    What is the value of  result after the following code executes?   int a = 60; int b = 15; int result = 20; if (a = b) result *= 3; 30 20 60 10 code will not execute The numeric data types in C++ can be broken into two general categories which are integers and floating-point numbers singles and doubles real and unreal numbers numbers and characters numbers and literals Which line in the following program will cause a compiler error?...

  • Java Questions A class must implement at least one interface. Question 1 options: True False Question...

    Java Questions A class must implement at least one interface. Question 1 options: True False Question 2 (1 point) Abstract methods can be called. Question 2 options: True False Question 3 (1 point) Constructors Question 3 options: Are inherited but cannot be accessed Are inherited and can be accessed Are accessible but are not inherited Are not inherited and cannot be accessed Question 4 (1 point) We can instantiate an object from an abstract class. Question 4 options: True False...

  • JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation...

    JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation in the program. True False QUESTION 2 To use a predefined method you must know the code in the body of the method. True False QUESTION 3 A formal parameter is a variable declared in the method heading (ie. it's signature). True False QUESTION 4 A local identifier is an identifier that is declared within a method or block and that is visible only...

  • 4. Write an if/else statement in ternary format that compares the value of two int variables, firstNum and secondNum, and sets the value of an int variable minValue appropriately as follows: minValue...

    4. Write an if/else statement in ternary format that compares the value of two int variables, firstNum and secondNum, and sets the value of an int variable minValue appropriately as follows: minValue should be the minimum of firstNum and secondNum. 5. Assume that Person is a predefined class and that the declaration Person[] people; has already been performed. Then the instruction People = new Person [200]; Reserves memory space for(Circle the answer):      Option 1: a single Person object      Option 2:...

  • review for the final 1. (1 point) Mark True or False in the left side of...

    review for the final 1. (1 point) Mark True or False in the left side of problems. (1) We can declare an array of string as string) greetings = {"good", "excellent"); (2) To declare and initialize an int variable i to be 2, we can write int=2; (3) For a properly declared and initialized int variable num, a condition to represent that num is between 10, 100) is written as (num >= 0 || num < 100). (4) Every nested...

  • 4. Write an if/else statement in ternary format that compares the value of two int variables,...

    4. Write an if/else statement in ternary format that compares the value of two int variables, firstNum and secondNum, and sets the value of an int variable minValue appropriately as follows: minValue should be the minimum of firstNum and secondNum. 5. Assume that Person is a predefined class and that the declaration Person[] people; has already been performed. Then the instruction People = new Person [200]; Reserves memory space for(Circle the answer):      Option 1: a single Person object     ...

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