• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

Cs21-midterm exam with complete solutions 2024.

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

Cs21-midterm exam with complete solutions 2024.

Vista previa del contenido

Cs21-midterm exam with completej j j


solutions 2024
j j




Files jthat jcontain jJava jbytecodes jfor jexecution jmust jhave jthe jextension j-
jANSWER✓✓-.class


The j___ jwindow jis ja jspecial jtext-only jwindow jin jwhich jJava jprograms jinteract
jwith jthe juser j- jANSWER✓✓-console


Java jrequire jthe jname jof jthe jfile jcontaining ja jprogram jmust jbe jthe jsame jas
jthe jname jof jthe jclass jdefined jin jthe jfile. j- jANSWER✓✓-True


In jjava, jwhat jcharacter jdo jall jescape jsequences jbegin jwith j? j- jANSWER✓✓-
backslash

A j__________ jis ja jprogram jthat jtranslates ja jcomputer jprogram jwritten jin jone
jlanguage jinto jan jequivalent jprogram jin janother jlanguage. j- jANSWER✓✓-
compiler

In jJava, jwhat jsymbols jare jused jto jcontain jall jmethods jwithin ja jclass jand jall
jlines jof jcode jwithin ja jmethod? j- jANSWER✓✓-curly jbrackets{}


In jJava, jthe jmethod jnamed j__________ jis jthe jstarting jpoint jfor jexecution. j-
jANSWER✓✓-main


In jJava, jwhat jsymbol jis jused jto jterminate jeach jstatement jof jcode jin ja
jprogram? j- jANSWER✓✓-semi-colon


________ jerrors jare jso jsevere jthat jJava jstops jyour jprogram jfrom jexecuting. j-
jANSWER✓✓-Runtime


Which jof jthe jfollowing jcharacters jis jNOT jallowed jas jthe jfirst jletter jof ja jJava
jidentifier? j- jANSWER✓✓-A jdollar jsign


Which jof jthe jfollowing jis ja jvalid jJava jstatement jfor jmultiplying jthe jinteger
jvariable jz jby j2? j- jANSWER✓✓-z j= jz*2; jz*=2


Declaring jmore jthan jone jvariable jin ja jsingle jdeclaration jstatement jis jallowed jin
jJava, jas jlong jas jall jthe jvariables jare jof jthe jsame jtype. j- jANSWER✓✓-True

, What jis jthe jvalue jof jx jafter jthe jfollowing jline jof jJava jcode jis jexecuted?

int jx j= j7 j- j(5 j+ j18 j/ j5) j+ j2 j* j(11 j% j6 j- j1); j- jANSWER✓✓-7

What jis jthe jvalue jof jx jafter jthe jfollowing jline jof jJava jcode jis jexecuted?

int jx j= j7 j- j(5 j+ j18 j/ j5) j+ j2 j* j11 j% j6 j- j1; j- jANSWER✓✓-2

If ja jvariable jis jdeclared jwithin ja jfor jloop, jthat jvariable jcan jstill jbe jaccessed
jafter jthe jloop jis jcompleted. j- jANSWER✓✓-False


The jproper jorder jof jthe jthree jelements jwithin jthe jparentheses jat jthe jbeginning
jof ja jfor jloop jare: jInitialization, jUpdate, jContinuation jTest. j- jANSWER✓✓-False


Type jcasting jmust jbe jused jin jJava jwhen jassigning jan jinteger jvalue jto ja
jfloating-point jvariable. j- jANSWER✓✓-False


In jJava, jvariables jmust jonly jbe jdeclared jone jtime. j- jANSWER✓✓-True

In jJava, jthe joperation j37 j/ j3 jwill jreturn jthe jvalue j12. j- jANSWER✓✓-True

The jthree jelements jwithin jthe jparentheses jat jthe jbeginning jof ja jfor jloop jmust
jbe jseparated jby j__________. j- jANSWER✓✓-Semi-colons


Given jthe jfollowing jJava jcode,

double jx j= jMath.floor(7.3);

the jvalue jof jthe jvariable jx jwill jbe j7. j- jANSWER✓✓-True

Suppose jyou jhave jdeclared ja jdouble jvariable jcalled jx jin ja jJava jprogram.
jWhich jis jthe jproper jway jto jset jx jequal jto jthe jsquare jroot jof j2 jby jusing jJava's
jsqrt jmethod? j- jANSWER✓✓-x j= jMath.sqrt(2)


Given jthe jfollowing jJava jcode,

double jx j= jMath.ceil(7.3);

the jvalue jof jthe jvariable jx jwill jbe j7. j- jANSWER✓✓-False

In jjava, jStrings jare jimmutable j- jANSWER✓✓-True

When jthe jfollowing jJava jcode jexecutes:

String jword j= j"Barcelona";
String jpart j= jword.substring(4,9);

Información del documento

Subido en
22 de octubre de 2024
Número de páginas
7
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$12.49

¿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

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BRAINSCAPE1
4.4
(22)
Vendido
148
Seguidores
15
Artículos
11130
Última venta
1 día hace



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