• ¿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 3 fuera de 22 páginas
Examen

Programming Languages: Final Exam Review Guide/ Qs & Ans/ .

Document preview thumbnail
Vista previa 3 fuera de 22 páginas

Programming Languages: Final Exam Review Guide/ Qs & Ans/ .

Vista previa del contenido

Programming Languages: Final Exam
Review Guide/ Qs & Ans/ 2024-2025.
Strong typing and weak typing. Static typing and dynamic typing. (Examples.
Why). - Answer: Strong Typing - a language is said to be strongly typed if it
prohibits, in a way that the language implementation can enforce, the application
of any operation to any object that is not intended to support that operation to
any object that is not intended to support that operation. (e.g., Java, C++,) Ruby is
strongly typed because once it knows the type of an object, it expects you to do
something that makes sense with it.
Ex:
x = "3"
y = x + "ho!"
#=> "3ho!"


but

,x = "3"
y=x+3
will produce an error.
------------------------------------------Weak Typing - a language that is being lenient
about what you can do with your typed variables. Javascript, however, is
dynamically but weakly typed because it lets you mix types together in your
expressions without throwing an exception. The danger? If you're not careful you
will get weird results.
----------------------------------------
Statically Typing - a language is said to be statically typed if it is strongly typed and
type checking can be performed at compile time.language has a type system that
is checked at compile time by the implementation (a compiler or interpreter) and
it is strongly typed. (e.g. Ada, Pascal, Lisp)
------------------------------------------
Dynamic Typing - Dynamic type checking is a form of late binding, and tends to be
found in languages that delay other issues until run time as well. (e.g., Python,
Ruby, Lisp)


Some languages have both static and dynamic type checking.
- Pascal, Java etc are mostly static typing.
- Python, PHP, and most script languages are dynamic typing.
- C++ are combined (support dynamic casting)

, Reference variables and value variables. - Answer: Reference Variable - It provides
an alias (alternative name) for a previously defined variable. References cannot be
null because every reference refers to some object.
Ex: int foo;
int& bar = foo;
bar is now a reference which means that bar holds the location of memory where
foo lies.


Value Variable -
d = a;
a = b + c;
In the first statement, the right hand side of the statement refers to the value of a,
which we wish to place into d. In the second statement, the left hand side refers
to the location of a, where we want to put the sum of b and c.


•Variables as values vs. variables as references
-value-oriented languages
•C, Pascal, Ada
-reference-oriented languages
•most functional languages (Lisp, Scheme, ML) •Clu, Smalltalk
-Algol-68 kinda halfway in-between -Java deliberately in-between
•built-in types are values •user-defined types are objects - references

Información del documento

Subido en
25 de junio de 2024
Número de páginas
22
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas
$23.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.
Studyresource1
4.6
(709)
Vendido
7253
Seguidores
24
Artículos
1349
Última venta
1 mes 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