Skip to content
VUBuddy

CS508 Midterm Solved Papers by Fatima Ali

Modern Programming Languages PDF 288 KBUpdated 23 Oct 2026
Midterm past paper CS508 Midterm Solved Papers by Fatima Ali PDF 288 KB
vubuddy.com
Type
Midterm past paper
Course
CS508 Modern Programming Languages
Size
PDF 288 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 288 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 16. Download the file for all 16 pages.

Cs508 mid-termJune 2016 paper

  1. LISP has only two data types: atoms and lists and syntax is based on lambda calculus.
  2. LISP stands for LIST processing language. It was designed by John McCarthy in 1959 as part of AI research at MIT to deal with problems of linguistic, psychology, and mathematics.
  3. The following comparative operators are used as functions for numerical values and return a T or NIL. =, >, =, <=;
  4. ALGOL 58 – 1958 – Search for a “Universal Language” ALGOL stands for Algorithmic Language. It was designed in 1958.

Salient features of the language are:

  • Concept of type was formalized
  • Names could have any length
  • Arrays could have any number of subscripts
  • Lower bound of an array could be defined
  • Parameters were separated by mode (in & out)
  • Subscripts were placed in brackets
  • Compound statements were introduced (begin ... end)
  • Semicolon as a statement separator was used
  • Assignment operator was :=
  • if had an else-if clause

Algol 60 - 1960 ALGOL 60 was a modified version of ALGOL 58. It added new features to the language. These included block structure (local scope), two parameter passing methods – value and name, subprogram recursion, and stack-dynamic arrays – run time size definition and space allocation. It did not have built-in I/O facility.

COBOL - 1960 COBOL was designed in 1960 to support business-oriented computation which requires fixed point arithmetic. It was designed to look like simple English to broaden the base of computer users. It was thus required to be easy to use, even if that means it will be less powerful. Another design consideration was that it must not be biased by current compiler. It encountered problems because the design committee members were all from computer manufacturers and DoD branches and there were fights among manufacturers. It was the first language to add macro facility in a high-level language. It also introduced hierarchical data structures (records) and nested selection statements. The language supported long variable names (up to 30 characters) with hyphens, data division, and fixed-point arithmetic. It was the first language required by DoD and would probably have failed without support from DoD. It is still a very widely used business applications language and is very popular in business and government, much less at universities.

Question: Describe the following statement by SNONOBOL :S(label2) F(label3)>> marks 2

Answer: (label) This is a command for unconditional jump to the label specified inside parentheses.

:S(label) This is a command for jump. It is used to the specified label if the statement in the body was executed successfully or resulted in true Boolean value.

:F(label) It is opposite to the second (label) :S (label). It the control jumps to the label if the statement is not executed successfully or resulted in false.

:S(label1) F(label2) It is a combination of the second (label) :S(label) and the third :F(label). It states that go to label1 in case of success and label2 in case of failure. Question: write two point that differentiate the LISP language from other language. Marks 2

Answer: 1. A LISP program has two types of elements: Atoms lists 2. The first symbol is the name of the function. The rest are its arguments.

>(+ 1 3 5)

Question: Why we need single language Ada. Marks 2

Answer: The necessity for a single standard language was felt in 1975. The draft requirements were given the code name strawman. Strawman was refined to Woodman and then Tinman in 1976. Initial designs were submitted in 1978 and red and green short listed on the basis of these designs. Standard requirements were then refined to steelman. The designs were refined additional and finally in 1979 Green was selected. DoD announced that the language will be called Ada. In 1995 revision of Ada (Ada

  1. was developed by a small team managed by Tucker Taft. In both cases, the design need a public comment period where the designers answer back to public comments.

Question: Set the value of variable a HEIGHT =12 and Weight=5. Marks3

>(setf (get „a „weight) 5) ;

Question: What is difference b/w these two statements >(set-intersection L1 L2) and >(set-difference L1 L2) Marks 5

Q2. which data structure is more widely us in LISP programming?

Answer: Atoms and Lists.

Q4. Set the value of variable a HEIGHT =12 and Weight=5.

(setf (get „a „Width)5)

Q1. ; which predicate function will help for testing atoms?

Answer: >(member 'b L)

Question: what is the functionality of KEYWORD INT|CAHR IN snobol4 2

KEYWORD = ‘INT’ | ‘CHAR’

This statement assigns the pattern „INT‟ | „CHAR‟ to the variable KEYWORD.

Q2. what is error in it >(sqrt x) in LISP 3

Answer: X is unbound because this symbol doesn‟t have any value we will have to assign a value using setq, setf and set.

>(setq x 3) = 3

Q3. how many element in it (a (d e)) related to lisp 2

Answer: There are two elements.

  1. Atom = a
  2. List = (d e)

Question: what is valid or invalid statement in ADA language 5 a=(1....5) integer b=(1....5) integer c,d=(1....5) float condition a=b

All CS508 files →
CS508 Modern Programming Languages All CS508 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.