100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CS 326 Final

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
10-08-2025
Written in
2025/2026

CS 326 Final − Syntax and semantics − Naming, scopes and bindings − Control flow − Data types − Subroutines - answersGeneral issues in the design and implementation of a language: Mechanism for defining types (syntax, semantics) − Rules for: − type equivalence (when are the types of two values the same?) − type compatibility (when can a value of type A be used in a context that expects type B?) − type inference (what is the type of an expression, given the types of the operands?) - answersA type system consists of: ensure that a program obeys thecompatibility rules - answersType checking violation of compatibility rules - answersType clash − Strong typing - language prevents you from applying an operation to data for which it is not appropriate − Static typing - language has strong typing, and it does type checking at compile time − Dynamic typing - type checking done at run time - answersA language may have: language prevents you from applying an operation to data for which it is not appropriate - answersStrong typing language has strong typing, and it does type checking at compile time - answersStatic typing

Show more Read less
Institution
Cs 326
Course
Cs 326









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Cs 326
Course
Cs 326

Document information

Uploaded on
August 10, 2025
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

CS 326 Final
− Syntax and semantics

− Naming, scopes and bindings

− Control flow

− Data types

− Subroutines - answers✔✔General issues in the design and implementation of a language:



Mechanism for defining types (syntax, semantics)

− Rules for:

− type equivalence (when are the types of two values the same?)

− type compatibility (when can a value of type A be used in a context that

expects type B?)

− type inference (what is the type of an expression, given the types of the

operands?) - answers✔✔A type system consists of:



ensure that a program obeys thecompatibility rules - answers✔✔Type checking



violation of compatibility rules - answers✔✔Type clash



− Strong typing - language prevents you from applying an operation to data for which it is not
appropriate

− Static typing - language has strong typing, and it does type checking at compile time

− Dynamic typing - type checking done at run time - answers✔✔A language may have:



language prevents you from applying an operation to data for which it is not appropriate -
answers✔✔Strong typing



language has strong typing, and it does type checking at compile time - answers✔✔Static typing

, type checking done at run time - answers✔✔Dynamic typing



− Scheme - strong typing, but dynamic

− Smalltalk - strong typing, but dynamic (operations <=> messages

sent to objects)

− Ada - strong and static typing

− Pascal - "almost" strong and "almost" static typing

− C - weaker than Pascal, but static (not much done at run time)

− Java - strong typing, part done at compile time, part at run time - answers✔✔Type Systems Examples



collection of values for a domain - answers✔✔Type: Denotational



internal structure of data, described down to the level

of fundamental types

− built-in types (integer, character, real, etc), also called primitive or

predefined types

− composite types (array, record, set, etc) - answers✔✔Type: Constructive



interface that specifies the operations that can be applied to objects - answers✔✔Type: Abstraction



For writing: FileInputStream , BufferedReader



BufferedReader reader = new BufferedReader(new FileReader("input.txt"));



For Reading: FileOutputStream , PrintWriter



PrintWriter writer = new PrintWriter(new FileWriter("output.txt")); - answers✔✔Java File I/O
$8.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
newborn

Get to know the seller

Seller avatar
newborn stuvia
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
5 months
Number of followers
0
Documents
197
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions