Write a Perl script that creates a string variable with value “This is String One”. Converts it into array, replaces value of element 2 from “String” to “Act” and transforms array back to string. Finally, it prints original string, array and transformed string.
Answer) The Perl code the above question is below:
# This is our input string
$sentence = "This is String One";
# converting the string sentence into array
# by using split() function
my @spl = split(' ', $sentence);
# changing the element at index 2 to "Act"
@spl[2]="Act";
# joining the array back to string
$str = join(" ", @spl );
# printing the original string i.e sentence
print "The Original String: ";
print "$sentence\n";
# printing the array i.e spl
print "The array after spliting: ";
print "@spl\n";
# printing the transformed string i.e str
print "The transformed String: ";
print "$str\n";
CODE SCREENSHOT

OUTPUT SCREENSHOT

Write a Perl script that creates a string variable with value “This is String One”. Converts...
this is for script for terminal or putty question 1------ 1. Write a PERL script/program based on the following requirements. The program should to prompt the user for how many courses the plan to take next semester and ask the user to enter each of those courses before displaying all the information entered back on the screen. question 2------ 2. Write a PERL script that defines/declares an array or a list of elements. The array should hold three-letter abbreviations for...
Write a perl script to accomplish following tasks: 1. Prompt user to enter their name and age, and then calculate and display their age in days. 2. Initialize a 20-element array of numbers and print each element. 3. Get a system host name. 4. Get a web page and save it to a file. 5. List background services (daemons) on your system.
Write a C++ program that reads a string and creates a cyclical array. A cyclical array is an array when the last element is pointing to the first one. Then write a loop that uses pointers and loops through the array starting from the first element and finishes after it visits the first element 5 times.
JavaScript 1. Write a function which receives one argument (string) and converts the string to uppercase. function('abc') // returns 'ABC' 2. Write a function that accepts an array and a value. Find and return the first array element with bigger than given value. function([5,15,4],6) //returns 15 DO NOT USE THESE IN-BUILT FUNCTIONS BELOW endsWith() includes() indexOf() lastIndexOf() localeCompare() match() repeat() replace() search() slice() split() startsWith() substr() substring() toLocaleLowerCase() toLocaleUpperCase() toLowerCase() toString() toUpperCase() trim() valueOf() trimLeft and trimRight unshift() valueOf() includes()...
SHOW INPUT AND OUTPUT OF EVERYTHING .ALSO SCREEN SHOT THE RESULTS. PROGRAMMING IN PERL 2.8 Special Literals Three special literals __FILE__, __LINE__, and __PACKAGE__ represent the current filename, line number, and package name at that point in your program. They may be used only as separate tokens and will not be interpolated into strings. #!/usr/bin/perl print "File name ". __FILE__ . "\n"; print "Line Number " . __LINE__ ."\n"; print "Package " . __PACKAGE__ ."\n"; # theycan not be interpolated...
PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.
On question 1-3 can you please answer each script separately.
Please Use Perl Scripting
1. write a program that computes the circumference of a circle with a radius of 12.5. Circumference is 2π times the radius (approximately 2 times 3.141592654). The answer you get should be about 78.5. 2. Modify the program from the previous exercise to prompt for and accept a radius from the person running the program So, if the user enters 12.5 for the radius, she should...
In Matlab write a script that does the following. 1. Creates a row vector v = [3, 6, 9, 9, 15], and then manipulates v to create each of the following vectors (and then displays the result of each): (a) a = [9, 36, 81, 81, 225] (b) b = [ 1 3 , 1 6 , 1 9 , 1 9 , 1 15 ] (c) c = [1, 2, 3, 3, 5] (d) d = [15, 9, 9,...
1. Write a function that converts a string into an int. Assume the int is between 10 and 99. Do not use the atoi() or the stoi() function. 2. Write a function prototype for problem 1. 3. Write a function call for the function you defined in problem 1. 4. Write a function that converts an int between 10 and 99 into a string. 5. Write a function prototype for problem 4. 6. Write a function call for function you...
Write a Java program that does the following: 1. Creates a string array called firstNames that holds these values "John", "Frank", "Nick", "Amanda", "Brittany", "Amy", "Deborah", and "Stirling". 2. Creates another string array called lastNames that holds these values "Thompson", "Smith", "Jones", "Keribarian", "Lu", "Banafsheh", "Spielberg", "Jordan", "Castle" and "Simpson". 3. Now add a method that creates an array list called randomNames which picks a random first name from the array in step 1 and a random last name in...