0% found this document useful (0 votes)
5 views

Prog Lec

Uploaded by

c19-1633-217
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Prog Lec

Uploaded by

c19-1633-217
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Pre

Quiz 1

1965’s is a broad area of computer applications characterized by the use of symbolic

rather than numeric computations.

Select one:

a. Scientific Applications

b. BusinessApplications

c. ArtificialIntelligence

d. SystemsProgramming

The correct answer is: ArtificialIntelligence

The World Wide Web is supported by an eclectic collection of languages, ranging

from markup languages, such as HTML, which is not a programming language, to

general-purpose programming languages, such as Java

Select one:

a. Scientific Applications

b. BusinessApplications

c. WebSoftware

d. SystemsProgramming

The correct answer is: WebSoftware

A program is said to be reliable if it performs to its specifications under all conditions.

Select one:

a. Readability

b. Writability

c. Reliability

d. Portability

The correct answer is: Reliability


Identify what language criteria characteristics is described.

A language with a large number of basic constructs is more difficult to learn than one with a smaller
number.

a relatively small set of primitive constructs can be combined in a relatively small number of ways to
build the control and data structures of the language.

suppose a numeric type is used for an indicator flag because there is no Boolean type in the language.

Some languages have used matching pairs of special words or symbols to form groups. C and its
descendants use braces to specify compound statements.

ability to define and then use complicated structures or operations in ways that allow many of the
details to be ignored.

it means that there are very powerful operators that allow a great deal of computation to be
accomplished with a very small program.

is simply testing for type errors in a given program, either by the compiler or during program execution.

Your answer is correct.

The correct answer is: A language with a large number of basic constructs is more difficult to learn than
one with a smaller number. → Overall simplicity, a relatively small set of primitive constructs can be
combined in a relatively small number of ways to build the control and data structures of the language.
→ Orthogonality, suppose a numeric type is used for an indicator flag because there is no Boolean type
in the language. → Data Types, Some languages have used matching pairs of special words or symbols to
form groups. C and its descendants use braces to specify compound statements. → Syntax Design,
ability to define and then use complicated structures or operations in ways that allow many of the
details to be ignored. → Support for Abstraction, it means that there are very powerful operators that
allow a great deal of computation to be accomplished with a very small program. → Expressivity, is
simply testing for type errors in a given program, either by the compiler or during program execution. →
Type Checking

1960’s - 1070’s The operating system and the programming support tools of a

computer system are collectively known as its systems software.

Select one:

a. Scientific Applications

b. BusinessApplications

c. ArtificialIntelligence

d. SystemsProgramming

The correct answer is: SystemsProgramming


Your answer is correct.

The correct answer is:

There are 4 language categories, which are : [Imperative] wherein an algorithm is

specified in great detail, and the specific order of execution of the instructions or

statements must be included; [Functional] in which the process of building software

by composing pure functions, avoiding shared state, mutable data, and side-effects;

[Object oriented] is a computer programming model that organizes software design

around data, or objects, rather than functions and logic. An object can be defined as

a data field that has unique attributes and behavior, and lastly [Logic] a constructive

approach in Automated Theorem Proving, where logic proofs answer queries and

construct instantiation to requested variables.

1950’s are characterized by facilities for producing elaborate reports, precise ways of

describing and storing decimal numbers and character data, and the ability to specify

decimal arithmetic operations.

Select one:

a. Scientific Applications

b. BusinessApplications

c. ArtificialIntelligence

d. SystemsProgramming

The correct answer is: BusinessApplications

Quiz 2

It is a set of sentences.

Select one:

a. language

b. lexeme

c. sentence
d. token

The correct answer is: language

The correct answer is:

Fill in the blanks

A compiler normally translates the whole [source program] into the object program.

Some computer languages use an [interpreter] to translate the source program into

the object program. Interpretation refers to the process of [translating] each line of the

[ source program] into the corresponding line of the object program and [executing ]

the line.

It is the most basic type of computer languages, consisting of strings of numbers the

computer's hardware can use.

Select one:

a. Machine languages

b. Assembly languages

c. Higher Level Language

d. Notable Languages

The correct answer is: Machine languages

If a program that describes a computation is written in a language not designed for

such use, the program may be unnatural and convoluted, making it unusually difficult

to read.

Select one:

a. Readability

b. Writability

c. Reliability

d. Portability

The correct answer is: Readability


A second-generation languages, are only somewhat easier to work with than

machine languages.

Select one:

a. Machine languages

b. Assembly languages

c. Higher Level Language

d. Notable Languages

The correct answer is: Assembly languages

The correct answer is:

A typical C program development environment have different phases, re-arrange the

phases below:

1. [Editor]

2. [Preprocess]

3. [Compile]

4. [Link]

5. [Load]

6. [Execute]
Mid

Quiz 1

Your answer is correct.

The correct answer is:

[Backus-Naur Form] (BNF) and [context-free grammars] (CFG) are equivalent

metalanguages that are well suited for the task of describing the syntax of

programming languages.

An [attribute grammar] is a descriptive formalism that can describe both the syntax

and static semantics of a language.

An [operational semantics] is a method of describing the meaning of language

constructs in terms of their effects on an ideal machine.

[Denotational semantics] mathematical objects are used to represent the meanings of

language constructs.

[Language entities] are converted to these mathematical objects with recursive

functions.

[Axiomatic semantics,] which is based on formal logic, was devised as a tool for

proving the correctness of programs.

The syntax is about “meaning” and semantics about “form”.

Select one:

True

False

The correct answer is 'False'.

Postcondition is an assertion following a statement.

Select one:

True

False

The correct answer is 'True'.


Your answer is correct.

The correct answer is: The change in the state of the machine (memory, registers,

stack, heap, etc.) defines the meaning of the statement. → Operational semantics,

Describe the meaning of a program in language L by specifying how statements

affect the state of a machine, (simulated or actual) when executed. → Operational

semantics, Define axioms and inference rules in logic for each statement type in the

language (to allow transformations of expressions to other expressions) → Axiomatic

Semantics, Based on formal logic (first-order predicate calculus) → Axiomatic

Semantics, A technique for describing the meaning of programs in terms of

mathematical functions on programs and program components. → Denotational

Semantics, Programs are translated into functions about which properties can be

proved using the standard mathematical theory of functions, and especially domain

theory. → Denotational Semantics

The weakest precondition is the least restrictive precondition that will guarantee the

postcondition

Select one:

True

False

The correct answer is 'True'.

The postcondition is an assertion before a statement states the relationships and

constraints among variables that are true at that point in the execution

Select one:

True

False

The correct answer is 'False'.


Which of the following is the process of building a denotational specification for a

language(select 2)

Select one or more:

a. Define a mathematical object for each language entity

b. Define a function that maps instances of the language entities onto

instances of the corresponding mathematical objects

c. Build a simulator for the idealized computer

d. Build a translator (translates source code to the machine code of an

idealized computer)

Your answer is correct.

The correct answers are: Define a mathematical object for each language entity,

Define a function that maps instances of the language entities onto instances of the

corresponding mathematical objects

To use Denotational semantics for a high-level language, a virtual machine in

needed

Select one:

True

False

The correct answer is 'False'.

Fin

Quiz 1

Data types are those who are not composed of other data types.

Select one:

a. Data types

b. Void
c. Built-in

d. Char

The correct answer is: Built-in

It identify the type of data and associated operation of handling it.

Select one:

a. Data types

b. Void

c. Built-in

d. Char

The correct answer is: Data types

Declaration and Initialization of structure starts with ________ keyword.

Select one:

a. struct

b. union

c. int

d. char

The correct answer is: struct

Data type specifies an empty set of values

Select one:

a. Data types

b. Void

c. Built-in

d. Char

The correct answer is: Void


Declaration and Initialization of union starts with ________ keyword

Select one:

a. struct

b. union

c. int

d. char

The correct answer is: union

Which of the following are a derived data types. (choose 4)

Select one or more:

a. Array

b. Functions

c. Pointers

d. Constant

e. Short

Your answer is correct.

The correct answers are: Array, Functions, Pointers, Constant

It is a representation of the object.

Select one:

a. Class

b. Object

c. Method

d. Function

The correct answer is: Class

It is the actual run time entity which holds data and function that has been defined in

the class.

Select one:
a. Class

b. Object

c. Method

d. Function

The correct answer is: Object

Identify what data type is described

Your answer is correct.

The correct answer is: are the whole numbers such as 5,39,-1917,0, etc. → Integers,

they have no fractional part. → Integers, An identifier declared as int cannot have a

fractional part. → Integers, It can store any member of the c++ implementation’s

basic character set → Character, An identifier declared as char becomes a

character variable. → Character, A number having a fractional part. → Float, The

decimal point shows that it is a floating-point number, not an integer. → Float, It

occupies twice as much memory as a float. → Double, It is used when the float is too

small or insufficiently precise. → Double

Fin

Quiz 2

Operand evaluation order is important in functional side effects are possible.

Select one:

True

False

The correct answer is 'True'.

________ in expressions are common, although they eliminate the error detection

benefit of type checking , thus lowering reliability.

Select one:

a. Associativity
b. Operand

c. Coercion

d. Assignment

The correct answer is: Coercion

Type Conversion can be widening or borrowing.

Select one:

True

False

The correct answer is 'False'.

It is a statements appeared in a wide variety of forms, including conditional targets ,

assigning operators and list assignments.

Select one:

a. Associativity

b. Operand

c. Coercion

d. Assignment

The correct answer is: Assignment

It is a statements include target variable , assignment operators and expressions.

Select one:

a. Expressions

b. Assignment

c. Semantics

d. Coercion

The correct answer is: Assignment

You might also like