CSC Final Exam (Past Exam
Questions)well answered to pass
(T/F) If A and B are both false, then the expression A && B is false. - correct answer ✔✔True
If A is true, B is false, C is false, what is the value of boolean expression A || B && C ? - correct answer
✔✔True
(T/F) Information in secondary memory is lost if the power is turned off. - correct answer ✔✔False
What is the result of the expression 2.0 + ? - correct answer ✔✔5.0
What output would be produced when the following code is executed?
String state = "Mississippi"; System.out.println(state.replace("is", "S")); - correct answer ✔✔MSsSsippi
(T/F) A comment in a Java program is ignored by the compiler. - correct 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");
- correct 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; - correct answer ✔✔6
, Which of the following is a valid Java identifier?
1stPlace
first@Place
first place
$FIRSTPLACE - correct answer ✔✔$FIRSTPLACE
(T/F) Java is an object-oriented programming language. - correct 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. - correct 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. - correct answer ✔✔if (number1 >= number2)
System.out.println(number1);
else
System.out.println(number2);
What output would be produced when the following code is executed?
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller BravelRadon. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $16.49. You're not tied to anything after your purchase.