CMIS 141 7984 Introductory Programming (2158)

CMIS 141 7984 Introductory Programming (2158)

Question 1 (1 point)

Question 1 Unsaved

According to the Google style guide, Java variable and class names should be named using UpperCamelCase.

Question 2 (1 point)

Question 2 Unsaved

Analyze the following code:

public class Test {
public static void main (String args[]) {
int i = 0;
for (i = 0; i < 10; i++);
System.out.println(i + 4);
}
}

Question 3 (1 point)

Question 3 Unsaved

What is the output of the following Java code? ____________________

public class Quizzes {
public static void main(String args[]){
String string1 = “243”;
System.out.println(Integer.parseInt(string1));
}
}

Question 4 (1 point)

Question 4 Unsaved

What is the value of balance after the following code is executed?

int balance = 10;
while (balance >= 1) {
if (balance < 9) {
break;
}
balance = balance – 9;
}

Question 5 (1 point)

Question 5 Unsaved

Which of the loop statements always have their body executed at least once.

 

Question 6 (1 point)

Question 6 Unsaved

What is the output of the following Java code: ______________________.

public class Quizzes {
public static void main(String args[]){
double angle = 90;
angle = Math.toRadians(angle);
System.out.println(Math.sin(angle) + Math.pow(Math.cos(angle),2));
}
}

Question 7 (1 point)

Question 7 Unsaved

What is the output of the following Java code: ______________________.

public class Quizzes {
public static void main(String args[]){
int momAge = 62;
int dadAge = 64;
System.out.println(Math.max(momAge, dadAge) + Math.min(momAge, dadAge));
}
}

Question 8 (1 point)

Question 8 Unsaved

Which of the following expression yields an integer between 0 and 100, inclusive?

Question 9 (1 point)

Question 9 Unsaved

What is the output of the following Java code: ______________________.

public class Quizzes {
public static void main(String args[]){
double length = 81;
double width = 144;
System.out.println(Math.sqrt(length) + Math.sqrt(width));
}
}

Question 10 (1 point)

Question 10 Unsaved

Analyze the following code.

int x = 0;
if (x > 0);
{
System.out.println(“x”);
}

Question 11 (1 point)

Question 11 Unsaved

What is the value of balance after the following code is executed?

int balance = 10;
while (balance >= 1) {
if (balance < 9) {
continue;
}
balance = balance – 9;
}

Question 12 (1 point)

Question 12 Unsaved

Using the Google style guide document, select the proper declaration of a Java constant.

Question 13 (1 point)

Question 13 Unsaved

Analyze the following code.

int x = 1;
while (0 < x) && (x < 100)
System.out.println(x++);

Question 14 (1 point)

Question 14 Unsaved

How many times will the following code print “Welcome to Java”?

int count = 0;
do {
System.out.println(“Welcome to Java”);
count++;
} while (count < 10);

Question 15 (1 point)

Question 15 Unsaved

Which of the following values would read using the Scanner nextShort() without producing an error?

Question 16 (1 point)

Question 16 Unsaved

What is the output of the following code:

int x = 9;
int y = 8;
int z = 7;

if (x > 9) {
if (y > 8){
System.out.println(“x > 9 and y > 8”);
}
else if (z >= 7){
System.out.println(“x <= 9 and z >= 7”);
}
else {
System.out.println(“x <= 9 and z < 7”);
}
}

Question 17 (1 point)

Question 17 Unsaved

How many times does the following loop iterate?

public class Quizzes {
public static void main(String args[]){
int cnt = 1;
int maxLoop = 30;
while (cnt < maxLoop) {
if (cnt==3) {
break;
}
cnt++;
}
}
}

Question 18 (1 point)

Question 18 Unsaved

What is the output of the following Java code?  ___________________

public class Quizzes {
public static void main(String args[]){
String string1 = “CMIS141 “;
String string2 = “is all”;
String string3 = “about Java!”;
String concat = string3.concat(string2).concat(string1);
System.out.println(concat.length());
}
}

Question 19 (1 point)

Question 19 Unsaved

What is the output of the following Java code:  ____________________.

public class Quizzes {
public static void main(String args[]){
double examAvg = 85.9983;
System.out.println(Math.ceil(examAvg));
}
}

Question 20 (1 point)

Question 20 Unsaved

What is the output of the following fragment?

int i = 1;
int j = 1;
while (i < 5) {
i++;
j = j * 2;
}
System.out.println(j);

Question 21 (1 point)

Question 21 Unsaved

What method would you use in the Scanner class to read an int from standard input in Java?

Question 22 (1 point)

Question 22 Unsaved

What is y after the following for loop statement is executed?

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

Question 23 (1 point)

Question 23 Unsaved

The following Java code contains valid brace placement according to the Google style guide

public class MyClass {
public static void main(String[] args)
{
System.out.println(“Welcome to CMIS 141”);
} // End of main
} // End class

Question 24 (1 point)

Question 24 Unsaved

Analyze the following two code fragments.

(i)
int x = 5;
if (0 < x) && (x < 100)
System.out.println(“x is between 1 and 100”);

(ii)
int x = 5;
if (0 < x && x < 100)
System.out.println(“x is between 1 and 100”);

Question 25 (1 point)

Question 25 Unsaved

How would you construct an instance of scanner class that will read from the standard input (keyboard) in Java?

 


"96% of our customers have reported a 90% and above score. You might want to place an order with us."

Essay Writing Service
Affordable prices

You might be focused on looking for a cheap essay writing service instead of searching for the perfect combination of quality and affordable rates. You need to be aware that a cheap essay does not mean a good essay, as qualified authors estimate their knowledge realistically. At the same time, it is all about balance. We are proud to offer rates among the best on the market and believe every student must have access to effective writing assistance for a cost that he or she finds affordable.

Caring support 24/7

If you need a cheap paper writing service, note that we combine affordable rates with excellent customer support. Our experienced support managers professionally resolve issues that might appear during your collaboration with our service. Apply to them with questions about orders, rates, payments, and more. Contact our managers via our website or email.

Non-plagiarized papers

“Please, write my paper, making it 100% unique.” We understand how vital it is for students to be sure their paper is original and written from scratch. To us, the reputation of a reliable service that offers non-plagiarized texts is vital. We stop collaborating with authors who get caught in plagiarism to avoid confusion. Besides, our customers’ satisfaction rate says it all.

© 2022 Homeworkcrew.com provides writing and research services for limited use only. All the materials from our website should be used with proper references and in accordance with Terms & Conditions.

Scroll to Top