100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Computer Science Test Questions (correct answers) $15.49   Add to cart

Exam (elaborations)

Computer Science Test Questions (correct answers)

 5 views  0 purchase
  • Course
  • Institution

Print writer correct answers What is used for writing output to a file? scanner correct answers What is used when getting input from a file? scanner correct answers Which of the following is not a primitive data type? float long Scanner char /n correct answers Which of the following...

[Show more]

Preview 2 out of 5  pages

  • May 3, 2023
  • 5
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
Computer Science Test Questions (correct answers)
PrintWriter correct answers What is used for writing output to a file?

scanner correct answers What is used when getting input from a file?

scanner correct answers Which of the following is not a primitive data type?
float
long
Scanner
char

/n correct answers Which of the following is an example of an escape sequence?
/n
while
main
Scanner

count == 1 correct answers Which of the following does not change the value of a
variable?
count++
count == 1
count += 1
count = 1
count = count + 1

Math.pow correct answers Which of the following should you use to compute the value
that results when raising one variable to the power of another (i.e, exponentiation)?
Math.pow
Math.random
**
++
^
none

ok will always be printed correct answers if( firstletter != 'y' || firstletter != 'Y')
System.out.println ( "ok" );

Which of the following true:
ok will always be printed
ok will never be printed
ok will be printed only when firstletter is neither 'y' nor 'Y'
the value of firstletter will be printed only if it has the value 'n'
none

, TestQuestion.java correct answers Suppose you implement a class with the header
// public class TestQuestion
The java source code for the class is stored in a file with the name:

19 correct answers How many times will the body of the loop execute?
for (int i = 1; i < 20, i++)
{
System.out.println ( i )
}

While correct answers What should you typically use if you want to continue asking the
user to enter a value whenever they type a invalid input?

Accumulating correct answers This term us used to describe variables that keep a
running total of something.

Variable correct answers A(n) _____ is a named storage location in a computer's
memory.

/* correct answers This marks the beginning of a multiline comment.

Literal correct answers A(n) ______ is a value like 'A' or 72 that is written into the code
of a program.

Narrowing Conversion correct answers A(n) _______ is a kind of type conversion which
causes an error because information may be lost.

Nested Loop correct answers This term describes a loop that appears inside another
loop.

Final correct answers This is a keyword used when declaring a variable which cannot
be changed.

A declaration opens up a space for a value in the computer's memory and an
assignment fills it with a value.
Declaration: Int Example;
Assignment: Example = #; correct answers What is the difference between a declaration
and an assignment? Give examples.

When your Java class doesn't have the right data type for what you need. correct
answers When is the use of a cast operation necessary?

= is a Simple assignment operator while == is Equal to. correct answers Explain how =
is different than ==.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

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

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

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 Governor001. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $15.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75323 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$15.49
  • (0)
  Add to cart