Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

Computer Science Test Questions (correct answers)

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

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 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 M 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)? M Mm ** ++ ^ none ok will always be printed correct answers if( firstletter != 'y' || firstletter != 'Y') Sln ( "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

Vista previa del contenido

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 ==.

Información del documento

Subido en
3 de mayo de 2023
Número de páginas
5
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas
$15.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
296
Última venta
-



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes