100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSCI1301 Exam 2 Questions 100% Solved. $10.49   Add to cart

Exam (elaborations)

CSCI1301 Exam 2 Questions 100% Solved.

 8 views  0 purchase
  • Course
  • CSCI
  • Institution
  • CSCI

CSCI1301 Exam 2 Questions 100% Solved. True or false: A while loop may execute the body of the loop *zero times* (perform zero iterations) - answerTrue A while loop keeps repeating the body of the loop until... - answerThe controlling Boolean expression becomes false What happens if a loop nev...

[Show more]

Preview 2 out of 7  pages

  • October 16, 2024
  • 7
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSCI
  • CSCI
avatar-seller
sirjoel
©SIRJOEL EXAM SOLUTIONS
10/11/2024 1:41 PM



CSCI1301 Exam 2 Questions 100% Solved.


True or false: A while loop may execute the body of the loop *zero times* (perform zero

iterations) - answer✔True


A while loop keeps repeating the body of the loop until... - answer✔The controlling Boolean

expression becomes false

What happens if a loop never reaches a stopping point and becomes an infinite loop? -

answer✔You have to abort the program manually


A for-loop has three parts: an initializing action, a Boolean expression, and an update action.

Which one of these three happens for the first time *after* the first iteration of the loop? -

answer✔Update Action


True or false: There are some situations where it is not possible to use a while loop. In these

situations, you must use a for loop. - answer✔False


True or false: It's typically better to use a do-while loop over a while loop if you know the loop

body will execute at least *once*. - answer✔True

, ©SIRJOEL EXAM SOLUTIONS
10/11/2024 1:41 PM


What is the main reason you would use a do-while loop over a while loop? - answer✔If you

want the loop body to execute at least once


What does the *continue* statement do? - answer✔Skips the current iteration of a loop body


True or false: A single array can contain values of *different* data types. - answer✔False


True or false: An array must contain at least *2* elements. - answer✔False


True or false: You could have a program that has 2 arrays. One array stores int values and the

other stores String values. - answer✔True


What index refers to the very first element of an array? - answer✔0


Is an array an object or a primitive type? - answer✔Object


How do you find the number of elements in an array? - answer✔Use arrayName.length


How is an object different from a class? - answer✔A class is a general definition for objects.

Objects are particular instances of the class which have values for the instance variables.


What are the two main things that a class specifies for objects? - answer✔Attributes and actions

(behaviors)


What type of method is the *main* method? - answer✔Void


True or false: Methods may have variables declared inside of them. - answer✔True

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

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. 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 study notes for 14 years now

Start selling
$10.49
  • (0)
  Add to cart