Skip to content
VUBuddy

CS508 Final Term Solved Subjective by Junaid

Modern Programming Languages PDF 887 KBUpdated 23 Oct 2026
Final term past paper CS508 Final Term Solved Subjective by Junaid PDF 887 KB
vubuddy.com
Type
Final term past paper
Course
CS508 Modern Programming Languages
Size
PDF 887 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 887 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 2, 3, 4 of 37. Download the file for all 37 pages.

Q.No.1 Write three concepts which are introduced in LISP first time?

  • Conditionals: such as if-then-else construct.
  • Function types: where functions are just like integers and strings
  • Recursion: first language to support it.
  • Dynamic typing: all variable are pointers.
  • Garbage-Collection.
  • Programs composed of expressions.
  • A symbol type.
  • The whole program is a mathematical function

Q.No.2 Write a function in LISP to concatenate two lists List a=(3 4 5) List b=(c d 6)

>(append '(3 4 5) '(c d 6)) (3 4 5 c d 6)..concatenated List

Q.No.3 Ada is strongly typed language describe how?

ADA is strongly typed. A programming language is strongly typed if type errors are always detected and in ADA Errors can be signaled as exceptions and handled explicitly.

automatically caught and handled through this exception mechanism, improving program reliability.

Q.No.4 How can we determine the size of Array in SNOBOL?

In SNOBOL, The size of the array can be determined at run time by using input from the system of using a variable. Example: A = ARRAY(INPUT)

Q.No.5 In C++ ^ and ~ are used for bitwise exclusive OR and bitwise NOT write there equivalent in ada?

^ bitwise exclusive OR of c++ = Xor in ADA.. ~ = Not in ADA

Q.No.6 What code in LISP language used to compute power of x to y?

(defun power (x y) (if (= y 0) 1 (* x (power x (1y))))) This function computes the power of x to y. That is, it computes xy by recursively multiplying x with itself y number of times. Example; >(power 3 4)

Q.No.7 A code was given about ADA case concept. Please refer topic "Case statement”

case expression is

when choice list =>

sequence-of-statements

when choice list =>

sequence-of-statements

when others =>

sequence-of-statements end case;

Q.No.8 Name functions that are used in List construction

Lists can be created and extended with the help of three basic functions.

  1. cons,
  2. list
  3. append

Q.No.9 Write IO header file for Ada.

Answer: with Ada. Text_Io; -- intent to use use Ada. Text_Io; -- direct visibility Q.No.10 What are operators for Logical AND && and Logical OR || used in ADA.

Logical AND &&= And in ADA Logical OR || = Or in ADA

Q.No.11 Features added in COBOL not included in SNOBOL.

COBOL has introduced hierarchical data structures (records) and nested selection statements.

The COBOL language supported long variable names (up to 30 characters) with hyphens, data division, and fixed-point arithmetic.

These all feature in COBOL language are those which were added or enhanced and were not included in SNOBOL.

Q.No.12 What is the functionality of KEYWORD INT|CAHR IN snobol4?

In SNOBOL 4 Vertical bar is used to specify pattern alternation. KEYWORD INT|CAHR This statement assigns the pattern ‘INT’ | ‘CHAR’ to the variable KEYWORD. KEYWORD will now get a new value which is ‘INT’ | ‘CHAR’ So we can create new pattern by using the assignment statement.

Q.No.13 Write two comparative operators used as function for numerical values in lisp programming language?

Comparative operators which are used as functions for numerical values are

Q.No.14 What is error in it >(sqrt x) in LISP?

This code generates an error as the symbol x is not associated with any value and thus cannot be evaluated. It will give error like this.

Error: The variable X is unbound.

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.