JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B. Tech III SCRIPTING LANGUAGES Previous Question Paper (August/September - 2021 - R18)

B. Tech | III | II | R18 | August/September - 2021

Answer PaperPaper Code: 156CUMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Describe about lexical and syntactic structure of Ruby language.

7 marks

Answer

Ruby is a case-sensitive, object-oriented language with a flexible lexical and syntactic structure. Lexically, Ruby source code is interpreted as UTF-8 by default. It uses whitespace for readability, but unlike Python, it does not use indentation to define blocks; instead, it uses keywords like do...end or begin...end. Identifiers follow specific conventions: local variables start with a lowercase letter or underscore, instance variables with @, class variables with @@, and global variables with $.

Syntactically, Ruby is highly expressive and emphasizes programmer productivity. It supports optional parentheses for method calls, allowing for a natural language style. Statements are typically terminated by newlines or semicolons. Blocks of code are first-class citizens, often passed to methods using yield or as Proc objects. The language supports various literals for strings, arrays, and hashes, and utilizes symbols (:symbol) for efficient identification.

b

How do we write CGI scripts using Ruby? Explain with simple CGI script?

8 marks

Answer

Ruby provides the cgi library to facilitate the creation of Common Gateway Interface (CGI) scripts. To write a CGI script, one must include the cgi module, instantiate a CGI object, and output the necessary HTTP headers followed by the HTML content. The script must be executable and reside in the server's cgi-bin directory.

Example of a basic Ruby CGI script:

#!/usr/bin/ruby
require 'cgi'
cgi = CGI.new("html4")
puts cgi.header
cgi.out do
  cgi.html do
    cgi.head { cgi.title { "CGI Script" } } +
    cgi.body { cgi.h1 { "Hello from Ruby CGI!" } }
  end
end

In this script, cgi.header generates the required Content-Type header, and the cgi.out method simplifies the generation of HTML tags by providing a block-based syntax for nesting elements.

215 marks
a

How do we do package management in Ruby using RubyGems?

7 marks

Answer

Sign in to view the complete answer paper.

b

Describe the usage of erb and eruby packages in Ruby.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Write the steps for building our own extensions in Ruby.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about different Ruby objects in C.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write a Ruby programming for wrapping of C structures in Jukebox extension.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about object creation and cloning of objects in Ruby.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Enumerate various characteristics of Scripting languages.

7 marks

Answer

Sign in to view the complete answer paper.

b

How do we create packages and modules in Perl?

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain about different uses of web scripting languages.

7 marks

Answer

Sign in to view the complete answer paper.

b

Compare Lists with Hashes in Perl language.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Illustrate file status check codes available in Perl using a program.

7 marks

Answer

Sign in to view the complete answer paper.

b

Summarize the steps for creating Internet-aware applications in Perl.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain how global, upvar and uplevel behaves in TCL with examples?

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain the list of available selection widgets in TK with examples.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of SCRIPTING LANGUAGES from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B. Tech IT III II, August/September - 2021, R18.

For the question paper without answers, switch to the Question Paper tab.

Other papers in SCRIPTING LANGUAGES

Loading Question Papers

Fetching data from database...