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)

CSC Final Exam (Past Exam Questions)

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
22-01-2025
Written in
2024/2025

CSC Final Exam (Past Exam Questions)

Institution
Course

Content preview

CSC Final Exam (Past Exam Questions)

(T/F) If A and B are both false, then the expression A && B is false. - ANSWER-True

If A is true, B is false, C is false, what is the value of boolean expression A || B && C ? -
ANSWER-True

(T/F) Information in secondary memory is lost if the power is turned off. - ANSWER-
False

What is the result of the expression 2.0 + ? - ANSWER-5.0

What output would be produced when the following code is executed?

String state = "Mississippi"; System.out.println(state.replace("is", "S")); - ANSWER-
MSsSsippi

(T/F) A comment in a Java program is ignored by the compiler. - ANSWER-True

What will be the out put when count is 4, sum is 10, MAX is 100?

if (count > 5) if (sum < MAX) System.out.println("cattywampus"); else
System.out.println("snickersnee"); - ANSWER-Nothing will print out.

If the current value of the integer variable count is 2, what value will be stored in count
after the following line of code is executed?

count = count++ * 3; - ANSWER-6

Which of the following is a valid Java identifier?

1stPlace
first@Place
first place
$FIRSTPLACE - ANSWER-$FIRSTPLACE

(T/F) Java is an object-oriented programming language. - ANSWER-True

Which of the statement is NOT true?

Numeric primitive values in Java are signed.
The int and short data types both represent integers.
Internally, an uppercase letter ('A') is treated the same as its lowercase version ('a').

, The boolean data type represents a true or false value. - ANSWER-Internally, an
uppercase letter ('A') is treated the same as its lowercase version ('a').

Write code that prints the greater value of two integers that are stored in the variables
number1 and number2. If both integers are equal, print the value of number1. Assume
that both variables have already been declared and given values. - ANSWER-if
(number1 >= number2)
System.out.println(number1);
else
System.out.println(number2);

What output would be produced when the following code is executed?

String greeting = "hello";greeting = greeting.toUpperCase();
System.out.println(greeting); - ANSWER-HELLO

Given the following declarations, which assignment statement would NOT cause the
compiler to issue an error?

int num1 = 5;
final int NUM_2 = 3500;
double num3 = 7.29;

char num4 = '5'; - ANSWER-num3 = num1 +num3;

Which of the following will produce a compile time error?

Omitting a necessary semicolon in a program.
Misspelling a word in the output.
Dividing by zero.
Computing the wrong answer. - ANSWER-Omitting a necessary semicolon in a
program.

Which of the following is NOT an example of the attribute of a Car class?

Register the car
The car's model
The car's color
The car's brand - ANSWER-Register the car

(T/F) A constructor of a class can have a different name than the class name. -
ANSWER-False

Assume count is an integer with value of 1, and index is an integer with value of 0.
What output is printed by the following code?

Written for

Course

Document information

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

Subjects

$11.99
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
EXAMHAVEN

Also available in package deal

Get to know the seller

Seller avatar
EXAMHAVEN Havard School
Follow You need to be logged in order to follow users or courses
Sold
4
Member since
1 year
Number of followers
2
Documents
1595
Last sold
4 months ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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