Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
43
Cijfer
A+
Geüpload op
22-03-2026
Geschreven 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.

Meer zien Lees minder
Instelling
APSU CSCI
Vak
APSU CSCI

Voorbeeld van de inhoud

] 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

Geschreven voor

Instelling
APSU CSCI
Vak
APSU CSCI

Documentinformatie

Geüpload op
22 maart 2026
Aantal pagina's
43
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€16,39
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
AnswersCOM Chamberlain School Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1351
Lid sinds
3 jaar
Aantal volgers
354
Documenten
26914
Laatst verkocht
9 uur geleden
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!

Lees meer Lees minder
3,6

251 beoordelingen

5
111
4
30
3
49
2
15
1
46

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen