• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 2 van de 7 pagina's
Tentamen (uitwerkingen)

Cmsc 255 Final Exam Review Actual Updated Questions And Correct Answers

Document preview thumbnail
Voorbeeld 2 van de 7 pagina's

CMSC 255 Final Exam Review ACTUAL UPDATED QUESTIONS AND CORRECT ANSWERS

Voorbeeld van de inhoud

CMSC 255 Final Exam Review ACTUAL UPDATED QUESTIONS AND CORRECT
ANSWERS

Which of the following lines of code correctly writes System.out.println("Hello");
"Hello" to the screen.


Fill in the blanks in the main method code below: public static void main (String[] args) {


The class name does not have to be the same as the False
filename in a Java program.




The command to compile a Java program is: javac
_____________ Hello.java.


Explain the steps that need to happen to take code from 1. Code is written in a an IDE or editor.
it being written to it running and producing output. 2. Code is compiled into a class file or byte code.
3. The byte code is run by the virtual machine and results are outputted.


What does the virtual machine do? Choose all answers runs byte code
that apply. runs the class file
runs byte code
generates source code
runs the class file


Logic errors are the hardest errors to find. True


While running a program, it unexpectedly stops. What logic
type of error is that? Choose all answers that apply. runtime
syntax
logic
compilation
runtime


Write the algorithm (pseudo or Java code) for the double employeeBonus;
following computer problem: employeeBonus = (profit * 0.3) / numEmployees;
Deer Enterprise needs a program to calculate their if profit > 7000000000 {
employee bonus. The bonus is based on the profits for employeeBonus += 1000;
the past year. They will take 30% of the profits and divide }
that amount among the employees. In addition, if the
profits are more than 7,000,000,000, the employees will
get an extra $1000.
(I recommend using the Preformatted text option instead
of the Paragraph text option. You can change this with the
dropdown next to the font size drop down)

, What is a variable? Choose all parts below that are named
relevant. memory location
unnamed can change
named
file location
cannot change
memory location
can change


Name two primitive Java data types that represent whole int, byte
numbers.


Name two primitive Java data types that represent double, float
floating point numbers.




For each error shown below match it to the correct Compile-time error:
output: a compile-time error, run-time error, or no error. System.out.Println("Greetings, Planet Earth!");


Compile-time error:
float scale = 7854.345368564323;


Run-time error:
System.out.println();


Compile-time error:
System.out.println("I love VCU!")


No error:
System.out.print(45 % 342);


What is displayed in the following code segment? System.out.println(numerator / denominator);
int numerator = 34; 5
int denominator = 6;
System.out.println(numerator % denominator)
4


A part of a program that contains information about the comment
program but has no effect when the program runs is
called a ____________ _.


Given the following declaration statement, write a count++
statement that increments the value in the variable count.
int count = 0;


Write a constant statement to hold the value of discount, final double DISCOUNT = 0.15;
which is 15%. ________________________


(remember to use proper java naming conventions for
constants)

Documentinformatie

Geüpload op
12 juni 2026
Aantal pagina's
7
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$14.99

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

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.
Briwisescore
2.5
(2)
Verkocht
43
Volgers
5
Items
17872
Laatst verkocht
5 dagen geleden



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