Question

Eclipse Java Oxygen Question 11 pts A compile-time error occurs when Group of answer choices c....

Eclipse Java Oxygen

Question 11 pts

A compile-time error occurs when

Group of answer choices

c. there’s a syntax error in a Java statement

a. the Java compiler can’t be located

b. bytecodes can’t be interpreted properly

c. there’s a syntax error in a Java statement

Flag this Question

Question 21 pts

An error that lets the application run but produces the wrong results is known as a

Group of answer choices

d. syntax error

c. logic error

a. runtime error

b. user error

Flag this Question

Question 31 pts

What is the range of values that x can hold after this statement is executed?

double x = Math.random() * 10 + 100;

Group of answer choices

b. 100 <= x < 110

c. 100 <= x < 200

a. 100 <= x < 101

d. 100 <= x < 1100

Flag this Question

Question 41 pts

If a = 5, b = 2, and c = 10, what is the value of c after the following statement is executed?

c = c + a * b – 5;

Group of answer choices

a. -45

d. None of the above

b. 15

c. 25

Flag this Question

Question 51 pts

Assume that before the following code is executed, the value of totalOne is 6.728, the value of totalTwo is 116, and both are BigDecimal objects. What is the value of totalFinal after the code is executed?

totalOne = totalOne.setScale(2, RoundingMode.HALF_UP);

BigDecimal totalFinal = totalTwo.add(totalOne);

Group of answer choices

d. 123

b. 122.72

a. 122.728

c. 122.73

Flag this Question

Question 61 pts

Assume that the variable named entry has a starting value of 9 and number has a value of 3. What is the value of entry after the following statements are executed?

if ((entry > 9) || (entry/number == 3)) {

    entry--;

} else if (entry == 9) {

    entry++;

} else {

    entry = 3;

}

Group of answer choices

a. 4

b. 8

d. 10

c. 6

Flag this Question

Question 71 pts

Which of the values below will not be printed to the console when this code is executed?

for (int i = 0; i < 3; i++) {

    for (int j = 0; j < 2; j++)     {

        if (i == j) {

            continue;

        }

        System.out.println("i = " + i + " j = " + j);

    }

}

Group of answer choices

b. i = 1 j = 0

d. i = 1 j = 1

a. i = 0 j = 1

c. i = 2 j = 0

Flag this Question

Question 81 pts

What is the value of maxNumber after the code that follows is executed?

int number = 0;

int maxNumber = 0;

for (int i = 0; i <= 10; i++) {

    number = (int)(Math.random() * 100);

    if (number >= maxNumber) {

        maxNumber = number;

    }

}

Group of answer choices

b. the largest of eleven random numbers from 0 to 99

a. the largest of ten random numbers from 0 to 99

d. An error that occurs after an application is running is known as a

c. the largest of ten random numbers from 100 to 1000

Flag this Question

Question 91 pts

What is the value of x after the following statements are executed?

int x = 5;

switch(x) {

    case 5:

        x += 2;

        break;

    case 6:

        x++;

        break;

    default:

        x *= 2;

        break;

}

Group of answer choices

c. 8

b. 7

a. 6

d. 10

Flag this Question

Question 101 pts

Assume that the variable named entry has a starting value of 9 and number has a value of 3. What is the value of entry after the following statements are executed?

if ((entry > 9) || (entry/number == 3)) {

    entry--;

} else if (entry == 9) {

    entry++;

} else {

    entry = 3;

}

Group of answer choices

c. 20

a. 3

d. 10

b. 8

Flag this Question

Question 111 pts

What happens in the method that follows when s is “two”?

public double parseInterval(String s)

{

    double interval = 0.0;

    try {

        interval = Double.parseDouble(s);

    } catch(NumberFormatException e) {

        System.out.println(e);

    }

    return interval;

}

Group of answer choices

c. "two" is returned

b. 0.0 is returned

a. 2.0 is returned

Flag this Question

Question 122 pts

Consider the code that follows. What does it do?

String value = "2";

boolean tryAgain = true;

while (tryAgain == true) {

    try {

        int num = Integer.parseInt(value);

        tryAgain = false;

    }

    System.out.println("Valid integer");

    catch(NumberFormatException nfe) {

        System.out.println("Invalid integer");

        System.out.print("Enter an integer");

        value = sc.next

    }

}

Group of answer choices

d. The code compiles but causes a runtime error.

b. It prints “Invalid integer” to the console.

c. The code doesn’t compile.

a. It prints “Valid integer” to the console.

Flag this Question

Question 131 pts

If number is 20, what is printed to the console after this code is executed?

for (int i = 3; i <= number; i += 2) {

    if (number % i == 0) {

        System.out.println(i);

        if (i == number) {

            System.out.println("special");

        }

        break;

    }

}

Group of answer choices

b. 5 special

d. 20 special

a. 5

c. 2

Flag this Question

Question 141 pts

How many lines are printed on the console when the following for loop is executed?

for (int j = 10; j < 40; j *= 2) {

    System.out.println(j);

}

Group of answer choices

b. 2

a. 1

c. 3

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

Question 11 pts

A compile-time error occurs when

Group of answer choices

c. there’s a syntax error in a Java statement

a. the Java compiler can’t be located

b. bytecodes can’t be interpreted properly

c. there’s a syntax error in a Java statement

Answer is c

Compile time error occurs during the compiler check the program compiled. Compiler will terminate the program with error when a syntactical error is encountered.


An error that lets the application run but produces the wrong results is known as a

Group of answer choices

d. syntax error

c. logic error

a. runtime error

b. user error


Answer is c (logical error)

In the case where the application runs without both compile time error and run time error and produces the wrong results then the program have logical errors.


Question 31 pts

What is the range of values that x can hold after this statement is executed?

double x = Math.random() * 10 + 100;

Group of answer choices

b. 100 <= x < 110

c. 100 <= x < 200

a. 100 <= x < 101

d. 100 <= x < 1100


Answer is b (100 <= x < 110)

Math.random() will generate values from 0 inclusive to 1 exclusive.
Then Math.random()*10 will generate values from [0,10)
Add 100 to above result will yield [100,110)
which means values from 100 inclusive to 110 exclusive.


Question 41 pts

If a = 5, b = 2, and c = 10, what is the value of c after the following statement is executed?

c = c + a * b – 5;

Group of answer choices

a. -45

d. None of the above

b. 15

c. 25

Answer is b (15)

first multiplication happes which yields c+10-5
which will result in 15

Assume that before the following code is executed, the value of totalOne is 6.728, the value of totalTwo is 116, and both are BigDecimal objects. What is the value of totalFinal after the code is executed?

totalOne = totalOne.setScale(2, RoundingMode.HALF_UP);

BigDecimal totalFinal = totalTwo.add(totalOne);

Group of answer choices

d. 123

b. 122.72

a. 122.728

c. 122.73

Answer is c (122.73)

FirstLine will change the value of totalOne from 6.728 to 6.73

Second line will add up the values totalOne and totalTwo i.e 6.73 + 116 = 122.73

First four questions are answered. Please ask remaining questions as another question.

Feel free to ask any doubts, if you face any difficulty in understanding.

Please upvote the answer if you find it helpful

Add a comment
Know the answer?
Add Answer to:
Eclipse Java Oxygen Question 11 pts A compile-time error occurs when Group of answer choices c....
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
  • Please answer and explain thank you. Question 1 What will be printed when the following code...

    Please answer and explain thank you. Question 1 What will be printed when the following code is executed? double x = 45678.259; System.out.printf("%,.2f", x); Group of answer choices 45678.259 0,045,678.26 45,678.26 45,678.3 Question 2 What will be printed when the following code is executed? double x = 45678.259; String output = String.format("%,.1f", x); System.out.println(output); Group of answer choices 45678.259 45,678.259 45,678.26 45,678.3 Question 3 What will be the value of ans after the following code has been executed? int ans=0;...

  • Question 11 pts An annuity is best defined as: Group of answer choices a series of...

    Question 11 pts An annuity is best defined as: Group of answer choices a series of payments for a specified period of time any series of payments a series of equal payments occurring at equal time intervals for a specified number of periods a series of equal payments for a specified number of years Flag this Question Question 21 pts A perpetuity can be described as: Group of answer choices an annuity that goes on forever an annuity that lasts...

  • Question 11 pts Fill in the blank. Two functions are defined main.c and MyAge.c   // FILE...

    Question 11 pts Fill in the blank. Two functions are defined main.c and MyAge.c   // FILE main.c main ( ) { _______ int age ; printf ( " the value of age is %d \n", age ) ; } // FILE MyAge.c int age = 10; int MyAge ( ) { } Group of answer choices static external internal extern Flag this Question Question 21 pts Fill in the blank. Two functions are defined main.c and MyAge.c   The below program...

  • Question 37 2.5 pts In a leveraged approach, a company will have Group of answer choices...

    Question 37 2.5 pts In a leveraged approach, a company will have Group of answer choices a wide contribution margin. high variable costs. low fixed costs. None of these. Flag this Question Question 38 2.5 pts Chapter 7 bankruptcy Group of answer choices requires liquidation of all of the assets of a company. requires payment to the creditor. is known as fresh start bankruptcy. All of these Flag this Question Question 39 2.5 pts Bankruptcy petitions are filed initially in...

  • If L1 and L2 are Regular Languages, then L1  ∪ L2  is a CFL. Group of answer choices...

    If L1 and L2 are Regular Languages, then L1  ∪ L2  is a CFL. Group of answer choices True False Flag this Question Question 61 pts If L1 and L2 are CFLs, then L1  ∩ L2 and L1 ∪ L2 are CFLs. Group of answer choices True False Flag this Question Question 71 pts The regular expression ((ac*)a*)* = ((aa*)c*)*. Group of answer choices True False Flag this Question Question 81 pts Some context free languages are regular. Group of answer choices True...

  • 1. Which of the following are appropriate uses of HTML (and NOT CSS)? a) Group of...

    1. Which of the following are appropriate uses of HTML (and NOT CSS)? a) Group of answer choices b) Making text red c) Making text larger d) Signifying that text is a heading e) Arranging arbitrary things in a grid f) Grouping related content g) Moving a navigation bar to the left edge of the screen h) Specifying the order of items in a list 2. When a form is submitted, what data is sent to the server about the...

  • Question 71 pts What is an isotope? Group of answer choices An atom that has more...

    Question 71 pts What is an isotope? Group of answer choices An atom that has more or fewer neutrons than it typically does An atom that has double the protons of a stable atom A nucleus of an atom that has split during the decay process An atom that has more or fewer electrons than it typically does Flag this Question Question 82 pts When the radiometric clock starts ticking in zircon minerals, there is 100% of the unstable radiometric...

  • I am currently using eclipse to write in java. A snapshot of the output would be...

    I am currently using eclipse to write in java. A snapshot of the output would be greatly appreciated to verify that the program is indeed working. Thanks in advance for both your time and effort. Here is the previous exercise code: /////////////////////////////////////////////////////Main /******************************************* * Week 5 lab - exercise 1 and exercise 2: * * ArrayList class with search algorithms * ********************************************/ import java.util.*; /** * Class to test sequential search, sorted search, and binary search algorithms * implemented in...

  • Question 150 pts This is also called non fermentable fiber: Group of answer choices Monosaccharides Disaccharides...

    Question 150 pts This is also called non fermentable fiber: Group of answer choices Monosaccharides Disaccharides Insoluble Fiber Soluble Fiber Functional Fiber Flag this Question Question 160 pts Which of the following statements are NOT True concerning fats and lipids? Group of answer choices Fats and oils in food are mostly in the form of triglycerides Lecithin is an example of a sterol Cholesterol is made by the body in adequate amounts to meet our needs Phospholipids are another class...

  • IN C++ Help to fix code Library management program. Error is when i type a letter...

    IN C++ Help to fix code Library management program. Error is when i type a letter into options menu the code breaks. after your edits, the code should still run as normal. CODE: #include<iostream> using namespace std; //structure to store library data class BookDetails{ public: struct library { int code; char title[20]; int status; }; library book_details[100]; }; //structure to store user data class UserDetails:public BookDetails{ public: struct users { int id; char name[20]; int booksNumber; }; users user_details[100]; };...

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