Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CSCI 2010 Mock Midterm Exam, Computer Science 2010, Practice MCQs with Answer Key 2026

Rating
-
Sold
-
Pages
43
Grade
A+
Uploaded on
22-03-2026
Written in
2025/2026

This document contains multiple-choice questions for CSCI 2010, designed as a mock midterm exam with a complete answer key. It covers core topics typically assessed in the midterm and is ideal for exam preparation and self-testing.

Show more Read less
Institution
APSU CSCI
Course
APSU CSCI

Content preview

] CSCI 2010 – Mock Midterm Exam
(MCQs) with Answers key
Section A: Java Basics & Output

1. If you compile a Java source file containing a class called MyApp, what is the name of the
resulting file?
A. MyApp.java
B. MyApp.class
C. MyApp.txt
D. MyApp.exe



2. Given the code:

String greeting = "Hello there!";
System.out.println(greeting.length());


What is displayed?
A. 11
B. 12
C. 13
D. 14



3. Which object is used to display normal output to the screen?
A. Scanner
B. System.out
C. Console
D. PrintStream



4. Which statement reads an integer from the keyboard?
A. number = keyboard.readInt();
B. number = keyboard.nextInt();
C. number = System.in.readInt();
D. number = Scanner.next();




Page 1 of 43 3/21/2026, 6:54:41 PM

, 5. Which keyword is NOT required when declaring a named constant?
A. final
B. void
C. public
D. static



6. The Java compiler translates source code into:
A. Machine code
B. Assembly code
C. Bytecode
D. Object code



7. Which is used to display formatted output?
A. System.out.print()
B. System.out.println()
C. System.out.printf()
D. print.format()




Section B: Classes & Objects

8. What is the relationship between a class and an object?
A. A class is a blueprint for creating objects
B. An object is a blueprint for creating classes
C. Classes and objects are equivalent
D. Objects cannot exist without classes



9. Which of the following does NOT increase the value of number by 1?
A. number += 1
B. number + 1
C. number = number + 1
D. number++



10. Correct way to test if two strings s1 and s2 are exactly the same:
A. s1 == s2
B. s1.equals(s2)
C. s1.compareTo(s2)
D. s1.equalsIgnoreCase(s2)




Page 2 of 43 3/21/2026, 6:54:41 PM

, 11. Difference between a while loop and a do-while loop:
A. while evaluates after the loop; do-while before
B. while evaluates before the loop; do-while after
C. while runs once; do-while may not run
D. No difference



12. Why is using a DEBUG flag helpful when tracing variables?
A. It allows variables to be hidden
B. It turns tracing messages on and off easily
C. It speeds up compilation
D. It prevents runtime errors



13. What is displayed by the code:

for (int i = 1; i <= 5; i++)
if (i == 4)
break;
System.out.println("boing");


A. boing boing boing boing
B. boing boing boing
C. boing boing
D. boing



14. Which Java type is used for true/false values?
A. Boolean
B. boolean
C. int
D. String



15. Correct way to call the exit method in Java:
A. exit(0);
B. System.exit(0);
C. System.terminate();
D. exitProgram();



16. Correct way to declare an enumeration:
A. enum Suits { HEARTS, SPADES, DIAMONDS, CLUBS }
B. enum Suits = [HEARTS, SPADES, DIAMONDS, CLUBS];




Page 3 of 43 3/21/2026, 6:54:41 PM

, C. enum Suits();
D. enum Suits { "HEARTS", "SPADES", "DIAMONDS", "CLUBS" };




Section C: Loops & Methods

17. Equivalent while loop for:

for (count = 0; count < 4; count++)
System.out.println(count);


A. count = 0; while (count < 4) { count++; }
B. count = 0; while (count < 4) { System.out.println(count); count++; }
C. count = 1; while (count < 4) { System.out.println(count); }
D. count = 0; while (count <= 4) { System.out.println(count); count++; }



18. How does a while loop work?
A. Repeats the body until the controlling expression is false
B. Repeats once then stops
C. Executes only if the expression is true
D. Loops infinitely by default



19. A method is:
A. A variable in a class
B. A member of a class that defines an operation on an object
C. A type of constructor
D. A static class



20. Calling a method within the same class using methodName() is equivalent to:
A. this.methodName()
B. super.methodName()
C. ClassName.methodName()
D. methodName(); (no difference)



21. Difference between public and private instance variables:
A. Public accessible only inside the class
B. Private accessible outside the class
C. Public accessible outside; private accessible only inside
D. No difference




Page 4 of 43 3/21/2026, 6:54:41 PM

Written for

Institution
APSU CSCI
Course
APSU CSCI

Document information

Uploaded on
March 22, 2026
Number of pages
43
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$18.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
AnswersCOM Chamberlain School Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
1347
Member since
3 year
Number of followers
354
Documents
26884
Last sold
3 days ago
Academic Guru

In my profile, you'll find a range of study resources, including detailed lecture notes, comprehensive summaries, and challenging practice exams. These materials are designed to help you grasp key concepts, review efficiently, and perform your best during assessments.I'm here not just to share but also to learn. Feel free to connect, ask questions, and share your insights. Together, we can make the learning journey more enriching. Browse through my materials, and I hope you find them beneficial for your academic success. Happy studying!

Read more Read less
3.6

248 reviews

5
109
4
29
3
49
2
15
1
46

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions