Write a Ruby script to create a new string which is n copies of a given string where n is a non-negative integer.
View Solution โScripting Languages Lab Programs
This tutorial provides Lab Programs on various topics of Scripting Languages using Ruby, TCL and Perl. It includes string, numeric and conditional scripts, arrays and hashes in Ruby, TCL scripts for factorial, lists, sorting and files, and Perl scripts for list functions, pattern substitution, IP and e-mail validation and command line arguments.
Ruby Scripts
Write a Ruby script which accept the radius of a circle from the user and compute the perimeter and area.
View Solution โWrite a Ruby script which accept the users first and last name and print them in reverse order with a space between them.
View Solution โWrite a Ruby script to accept a filename from the user print the extension of that.
View Solution โWrite a Ruby script to find the greatest of three numbers.
View Solution โWrite a Ruby script to print odd numbers from 10 to 1.
View Solution โWrite a Ruby script to check two integers and return true if one of them is 20 otherwise return their sum.
View Solution โWrite a Ruby script to check two temperatures and return true if one is less than 0 and the other is greater than 100.
View Solution โWrite a Ruby script to print the elements of a given array.
View Solution โWrite a Ruby program to retrieve the total marks where subject name and marks of a student stored in a hash.
View Solution โTCL Scripts
Write a TCL script to find the factorial of a number.
View Solution โWrite a TCL script that multiplies the numbers from 1 to 10.
View Solution โWrite a TCL script for sorting a list using a comparison function.
View Solution โWrite a TCL script to (i) create a list (ii) append elements to the list (iii) Traverse the list (iv) Concatenate the list
View Solution โWrite a TCL script to comparing the file modified times.
View Solution โWrite a TCL script to Copy a file and translate to native format.
View Solution โPerl Scripts
a) Write a Perl script to find the largest number among three numbers.
View Solution โb) Write a Perl script to print the multiplication tables from 1-10 using subroutines.
View Solution โWrite a Perl program to implement the following list of manipulating functions a) Shift b) Unshift c) Push
View Solution โa) Write a Perl script to substitute a word, with another word in a string.
View Solution โb) Write a Perl script to validate IP address and email address.
View Solution โWrite a Perl script to print the file in reverse order using command line arguments.
View Solution โ