100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Loop Practice Exam Questions & Answers 2024/2025 £6.57   Add to cart

Exam (elaborations)

Loop Practice Exam Questions & Answers 2024/2025

 1 view  0 purchase
  • Module
  • Loop Practice
  • Institution
  • Loop Practice

Loop Practice Exam Questions & Answers 2024/2025 What is the output? for(int i = 0; i <= 5; i++){ Sln("Big Numbers! "+ i*2); } - ANSWERSBig Numbers! 0 Big Numbers! 2 Big Numbers! 4 Big Numbers! 6 Big Numbers! 8 Big Numbers! 10 Is this a valid loop? for(int i = 0, i <= 4, ...

[Show more]

Preview 2 out of 6  pages

  • August 4, 2024
  • 6
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Loop Practice
  • Loop Practice
avatar-seller
Loop Practice Exam Questions &
Answers 2024/2025

What is the output?



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

System.out.println("Big Numbers! "+ i*2);

} - ANSWERSBig Numbers! 0

Big Numbers! 2

Big Numbers! 4

Big Numbers! 6

Big Numbers! 8

Big Numbers! 10



Is this a valid loop?



for(int i = 0, i <= 4, i++){

} - ANSWERSNo, the variables in the loop are separated by semicolons not commas.



How many times will this loop execute?



for(int p = 2; p < 4; p++){

} - ANSWERS2 Times



What is the output?



for(int i = 5; i >= 1; i--){

, System.out.print("haha");

} - ANSWERShahahahahahahahahaha



Is this a valid loop?



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

} - ANSWERSNo, there shouldn't be a semicolon by the last variable (i++)



The purpose of a loop is to... - ANSWERSRepeat operation(s) many times



What is the output?



for(int i = 5; i > 0; i-- ){

int mysteryInt = 100;

mysteryInt -= i;

System.out.print(mysteryInt + ", ");

} - ANSWERS95, 96, 97, 98, 99,



What is the output?



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

for(int j = 1; j <= 7-i; j++){

System.out.print("*")

}

System.out.println("");

} - ANSWERS*******

******

*****

****

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 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 Bensuda. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67474 documents were sold in the last 30 days

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

Start selling
£6.57
  • (0)
  Add to cart