Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the result of 67 % 10? (2 points) Question 2Select one: a. 0.7 b. 6 c. 6.0 d. 7 e. 10 String line

What is the result of 67 % 10? (2 points)

Question 2Select one:

a. 0.7

b. 6

c. 6.0

d. 7

e. 10

String line = "Programming is my favorite!";

What is the value of line.length()? (2 points)

Question 4Select one:

a. 26

b. 27

c. 28

d. 29

e. 30

Assume that the Scanner class has already been imported. Consider the code block below.

  1. Scanner input = new Scanner (System.in);
  2. System.out.println("How old are you?");
  3. String age = input.next();
  4. int newAge = Integer.parse(age);

Which, if any, lines have errors on them? (2 points)

a. II only

b. IV only

c. I and III

d. II and IV

e. The code works as expected

Which of the following is true after the code executes? (2 points)

String anim1 = "dog"; String anim2 = "dog"; String anim3 = "cat";

a. anim1.equals(anim3)&& anim1.equals(anim2)

b. !anim1.equals(anim2)&& anim1.equals(anim2)

c. !anim1 == anim3 && anim1.equals(anim2)

d. !anim1.equals(anim3)&& anim1.equals(anim2)

e. anim1.equals(anim3)&& !anim1.equals(anim2)

Consider the code block below. What is printed as a result of newString("coding")? (2 points)

public static void newString(String word) {

String newStr = ""; for (int x = 0; x < word.length(); x+=2) {

newStr += word.substring(x);

} System.out.println(newStr); }

Question 15Select one:

a. codingdingng

b. bdingdingng

c. codingding

d. codingodingdingingngg

e. An IndexOutOfBoundsException occurs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

What is the group trying to achieve?

Answered: 1 week ago

Question

Are my points each supported by at least two subpoints?

Answered: 1 week ago