Programming Languages Exam 1

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

39 Terms

1
New cards

Prolog

Created in 1972, it is a logic programming language associated with artificial intelligence and computational linguistics.

2
New cards

Ruby

Developed in 1993 by Yukihiro Matsumoto with an emphasis on OOP from the beginning.

3
New cards

Java

Created by Sun Microsystems in 1995, it was popular with web-based applets. It's one of the most popular languages today.

4
New cards

JavaScript

Brandon Eich created this language in 1995. It is a very popular language to embed within HTML for client-side web scripting.

5
New cards

PHP

Developed by Rasmus Lerdorf in 1995, it is the most popular language for server-side scripting.

6
New cards

Objective-C

Created in the 80s by Love and Cox, it was the primary language for Apple software development.

7
New cards

Describe three reasons why it is a good idea for someone to study the concepts of programming languages.

options for reasons:

1. increased ability to express ideas

2. improved background for choosing appropriate languages

3. increased ability to learn new languages

4. better understanding of significance of implementation

5. better use of languages that are already known

6. overall advancement of computing

8
New cards

List three common criteria that are used to evaluate programming languages.

options:

1. readability

2. writability

3. reliability

4. cost

9
New cards

List four programming domains.

options:

1. scientific applications

2. business applications

3. AI

4. systems programming

5. web software

10
New cards

List four language categories.

1. imperative

2. functional

3. logic

4. markup/programming hybrid

11
New cards

language design trade-offs

- reliability vs. cost of execution

- readability vs. writability

- writability (flexibility) vs. reliability

12
New cards

implementation methods

- compilation

- pure interpretation

- hybrid implementation systems

13
New cards

compilation phases

1. lexical analysis: converts characters in the source program into lexical units

2. syntax analysis: transforms lexical units into parse trees which represent the syntactic structure of the program

3. semantics analysis: generate intermediate code

4. code generation: machine code is generated

14
New cards

Von Neumann Bottleneck

program instructions can be executed much faster than the speed of the connection between a computer's memory and processor; the connection speed thus results in a bottleneck

- primary limiting factor in the speed of computers

15
New cards

examples of programming environments

- UNIX

- Microsoft Visual Studio .NET

- NetBeans

16
New cards

What is Fortran ranked on the Tiobe index?

in January 2025, 10; in January 2024, 12

17
New cards

T/F: Fortran is a strongly typed language, which means each variable must have a type.

T

18
New cards

What are the 5 built-in data types in Fortran?

1. integer

2. real

3. complex

4. character

5. logical

19
New cards

T/F: Fortran is case-sensitive.

F

20
New cards

Give two reasons for having a single language for all programming domains.

1. It would create ultimate standardization, where the programming language can be used across all development environments and machines. Due to the single language, it would require some extreme complexity to deliver functionality across all machines. Although it would be difficult to understand the language at first, extensive research would allow for numerous textbooks, videos, articles, etc. to be available to learn the language.

2. Therefore, once individuals learn the language, there would be overall simplicity since no other languages exist. (only one big learning curve, not many small learning hurdles)

21
New cards

Give two reasons against having a single language for all programming domains.

1. Programming domains exist for a reason; they each have their own set of requirements necessary for languages, and have language optimized for the programming domains. With a single language, this optimization would be impossible.

2. The language would be extremely complex and take much longer to learn due to its vast amount of design aspects it would require.

22
New cards

Name six attributes that can be used to characterize a variable.

1. name

2. address

3. value

4. type

5. lifetime

6. scope

23
New cards

What does it mean to have a binding of a variable?

A binding is an association between an entity and an attribute, such as between a variable and its type or value.

24
New cards

possible binding times with variables

- compile time: bind a variable to a type in C or Java

- load time: bind a C or C++ static variable to a memory cell

- runtime: bind a nonstatic local variable to a memory cell

25
New cards

static binding

first occurs before run time and remains unchanged throughout program execution

26
New cards

dynamic binding

first occurs during execution or can change during execution of the program

27
New cards

When does binding occur for a Fortran variable? Explain by using an example.

Binding occurs during compile time, not during run time. This means that Fortran variables use static binding, where the variable's type and memory allocation remain constant throughout execution.

For example, given the code:

integer :: height

real :: grade

height = 89

grade = 90.0

we can see that height and grade are bound to their data types and when they are given a value, memory is allocated based on the type, which stays constant.

28
New cards

In the history of computing, what are the two most influential programming languages? Provide evidence to support your answers.

The two most influential programming languages are C and Python. C inspired C++, Java, Python, and other languages that are all used commonly today. It was able to be understood at a high level, and although not object-oriented, inspired the structures of the popular object-oriented language C++. It can also be used in a wide variety of applications like writing operating systems and compilers. Python is influential due to its ease of use and applications. It is easy to teach and learn, but it also extremely powerful, especially in AI and statistics modeling applications. Although COBOL is different from Python, it seems to be its successor, as many individuals involved with business applications are learning to use Python, even though they are not working in the computer science field.

29
New cards

syntax

the form or structure of the expressions, statements, and program units

30
New cards

semantics

the meaning of the expressions, statements, and program units

31
New cards

What provides a language's definition?

syntax and semantics

32
New cards

Who are the users of a language's definition?

- other language designers

- implementors

- programmers (users of language)

33
New cards

sentential form

sentence that has only terminal symbols

34
New cards

leftmost derivation

the leftmost nonterminal in each sentential form is the one that is expanded

- practice examples of this

35
New cards

ambiguous grammar

a grammar is this IFF it generates a sentential form that has two or more distinct parse trees

36
New cards

operational semantics

Describe the meaning of a program by executing its statements on a machine, either simulated or actual. The change in the state of the machine (memory, registers, etc.) defines the meaning of the statement

37
New cards

Provide a syntax description for the Fortran while statement.

do while (condition)

// code block

end do

38
New cards

Describe the semantics of the Fortran while statement.

The condition is evaluated. If the condition is true, the code block is executed. Control moves back to the do while line and the condition is evaluated again. This process is repeated until the condition is false.

39
New cards

What is a Fortran derived type? When would it be needed?

It is a special form of data type that can encapsulate other built-in/intrinsic types as well as other derived types. It is similar to a struct in C/C++. It would be needed when a record needs to be represented, like with the ACM student membership data example.