Chat with us, powered by LiveChat CMIS 141 7984 Introductory Programming (2158) | WriteDemy

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

Question 1 options:TrueFalseQuestion 2 (1 point) 

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 2 options:

The program compiles despite the semicolon (;) on the for loop line, and displays 14.

The program compiles despite the semicolon (;) on the for loop line, and displays 4.

The program has a runtime error because of the semicolon (;) on the for loop line.

The program has a compile error because of the semicolon (;) on the for loop line.

Question 3 (1 point) 

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 3 options:Question 4 (1 point) 

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 4 options:

–1

0

1

2

None of the above

Question 5 (1 point) 

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

Question 5 options:

The while loop

The do-while loop

The for loop

None of the above

Question 6 (1 point) 

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 6 options:Question 7 (1 point) 

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 7 options:Question 8 (1 point) 

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

Question 8 options:

(int)(Math.random() * 101)

int)(Math.random() * 100)

(int)(Math.random() * 100) + 1

(int)(Math.random() * 100 + 1)

Question 9 (1 point) 

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 9 options:Question 10 (1 point) 

Analyze the following code.

    int x = 0;

    if (x > 0);

    {

      System.out.println(“x”);

    }

Question 10 options:

The symbol x is never printed.

The value of variable x is printed once.

No output is produced.

The symbol x is printed once.

Question 11 (1 point) 

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 11 options:

1

The loop does not end

2

0

-1

Question 12 (1 point) 

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

Question 12 options:

int CONSTANT SPEED = 3.0;

double final SPEED = 3.0;

float FINAL speed = 3.0;

Final SPEED = 3.0;

None of the above

Question 13 (1 point) 

Analyze the following code.

    int x = 1;

    while (0 < x) && (x < 100)

      System.out.println(x++);

Question 13 options:

The number 2 to 100 are displayed.

The code does not compile because the loop body is not in the braces.

The number 1 to 99 are displayed.

The code does not compile because (0 < x) & (x < 100) is not enclosed in a pair of parentheses.

The loop runs for ever.

Question 14 (1 point) 

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 14 options:

8

9

10

11

0

Question 15 (1 point) 

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

Question 15 options:

32768

-32768

-100000

100000

None of the above

Question 16 (1 point) 

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 16 options:

x > 9 and y > 8

x <= 9 and z >= 7

x <= 9 and z < 7

None of the above

Question 17 (1 point) 

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 17 options:Question 18 (1 point) 

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 18 options:Question 19 (1 point) 

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 19 options:Question 20 (1 point) 

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 20 options:

4

64

32

16

8

Question 21 (1 point) 

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

Question 21 options:

nextBoolean();

nextFloat();

nextByte();

nextInt();

None of the above

Question 22 (1 point) 

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

int y = 0;

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

   y += 1;   

}

Question 22 options:

9

10

11

12

None of the above.

Question 23 (1 point) 

The following Java code containsct back and honor the past events, the speech does not achieve its purpose.

I have a dream

https://www.youtube.com/watch?v=H0yP4aLyq1g

Organization

He starts by calming the crowd. Once he gains the attention he starts of his speech. He begins the speech by a reflective statement. “Even though we mumble I have a dream”

His ideas are very simple and precise. He is direct to the point e.g I have a dream that one day all will sit in one table in brother hood, every point he has begins with the I have a dream quote hence preparing audience that he is transiting from one point to another.

Language

The language is simple and precise.

The use of I have a dream quote emphasizes the points in the speech. Other phrases the speaker uses are with this faith, let the freedom ring all these phrases make the martins story memorable to the audience.

He repeats several word very many time such as freedom, justice, dream you and me among others.

Delivery

He is precise and to the point I have a dream

He has memorized his speech accordingly and does not have reference material.

He has a consistent eye contact.

He is repetitive of the main points.

He utilizes physical movement of his hands in emphasis of a point.

He poses from point to point. His speech is slow paced. Posing gives time to listeners to internalize information.

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order