100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CSCI1301 Exam 2 Questions 100% Solved.

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
16-10-2024
Written in
2024/2025

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 never reaches a stopping point and becomes an infinite loop? - answerYou 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? - answerUpdate 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. - answerFalse 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*. - answerTrue ©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? - answerIf you want the loop body to execute at least once What does the *continue* statement do? - answerSkips the current iteration of a loop body True or false: A single array can contain values of *different* data types. - answerFalse True or false: An array must contain at least *2* elements. - answerFalse True or false: You could have a program that has 2 arrays. One array stores int values and the other stores String values. - answerTrue What index refers to the very first element of an array? - answer0 Is an array an object or a primitive type? - answerObject How do you find the number of elements in an array? - answerUse arrayNh How is an object different from a class? - answerA 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? - answerAttributes and actions (behaviors) What type of method is the *main* method? - answerVoid True or false: Methods may have variables declared inside of them. - answerTrue

Show more Read less
Institution
CSCI
Course
CSCI

Content preview

©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

Written for

Institution
CSCI
Course
CSCI

Document information

Uploaded on
October 16, 2024
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
sirjoel Liberty University
View profile
Follow You need to be logged in order to follow users or courses
Sold
124
Member since
1 year
Number of followers
13
Documents
12605
Last sold
1 week ago
Sirjoel

Here you will find all documents and package deals offered by sirjoel

3.5

17 reviews

5
4
4
4
3
7
2
1
1
1

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions