100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Programming Fundamentals Final Exam With Complete Solutions Latest Update $13.49   Add to cart

Exam (elaborations)

Programming Fundamentals Final Exam With Complete Solutions Latest Update

 2 views  0 purchase
  • Course
  • Institution

Programming Fundamentals Final Exam With Complete Solutions Latest Update

Preview 3 out of 17  pages

  • July 22, 2024
  • 17
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
avatar-seller
Programming Fundamentals Final Exam With
Complete Solutions Latest Update

-24 % 5 is - correct answers -4



Assume x = 4 and y = 5, which of the following is true? - correct answers !(x != 5 ^ y != 4)



x != 4 ^ y == 5



!(x == 4) ^ y == 5



Which of the following is equivalent to x != y? - correct answers x > y || x < y



!(x == y)



What is the output from System.out.println((int)Math.random() * 4)? - correct answers 0



What is the printout of System.out.println('z' - 'a' + 2)? - correct answers 27



What would the following statement print?



System.out.println("abc".compareToIgnoreCase("AB")); - correct answers 1



Select what returns true. - correct answers "anna".equals("anna".concat(""))



"anna" == "anna"

,What is the output of the code:



System.out.println( 'C' - 'D' ); - correct answers -1



True or false:

System.out.println( "lafayette".substring(2, 4) );



prints "fay". - correct answers False



What is the printout of the following code?



System.out.println("a" + ('b' - 'c')); - correct answers a-1



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



int count = 0;

while (count < 10) {

System.out.println("Welcome to Java");

count++;

} - correct answers 10



The following loop displays ________.



for (int i = 1; i <= 20; i++) {

System.out.print(i + " ");

i +=2;

, } - correct answers 1 4 7 10



True or False:



Does the following loop have a compiling error?



for (; ; ); - correct answers Yes



public class Loops

{

public static void main(String[] args)

{

int i=0, j=0;

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

for (j = 0; j < i; j++)

;

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



}



} - correct answers 10 9



Analyze the following code.



int count = 0;

while (count < 100) {

// Point A

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Schoolflix. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $13.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

74735 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$13.49
  • (0)
  Add to cart