Question
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.
- Scanner input = new Scanner (System.in);
- System.out.println("How old are you?");
- String age = input.next();
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started