Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Perl take home final exam
1. Linux IV – Perl Programming
Take Home - Final Examination
LINUX IV – PERL PROGRAMMING
Directly print your code to short bond paper using notepad or DOS type command. Do not, copy paste it to other
application. This will have an effect to the code.
Staple the bond paper with this questionnaire, being the first page, before submitting it.
Write your printed name at the upper left side of every bond paper you’ve used and affix your signature on top of
the printed name.
Put it in a short brown envelope and write your name, course, and subject in front of the envelope.
Submit your exam papers personally on or before 10:00 P.M. of March 14, 2011, Monday. Time will be based on
the wall clock located at the stairway in ITCC.
Non-compliance with the above instructions would invalidate your exam and thus will require you to take the
special exam
Good luck and thank you for a wonderful semester!
Create a PERL script that will perform the following:
Name: ___________________________________ LINUX IV – PERL PROGRAMMING
TEST I – PERL PROGRAMMING
CELLPHONE TRANSACTION
Transaction Menu
1. View account Balance
2. Share-A-Load
3. Load
4. Text
5. Call
6. Exit
Choice:
Conditions:
The following are the conditions for call and text options:
- the user could only text if he/she has at lest 1 peso load
o if the account has less than 1 peso, then the message “Message Sending Failed!” will be displayed
o 1 peso per text
- The user can only call if he or she has at least 8 pesos in his/her account
- The user can share-a-load if he/she has enough balance in his/her account
Sample Output
View Account Balance
Your account balance as of today is 12.50
Share-A-Load
Enter Mobile Number: 09228545127
Amount: 10
Confirmation:
Your Share-A-Load has successfully sent!
1 peso service fee for the share-a-load transaction
Your current balance as of now is 1.50
Text
Enter Mobile Number: 09228545127
Message: Congratulations Pare!
2. Confirmation:
Message has been successfully sent
Call
Enter Mobile Number: 09228545127
Confirmation:
Your do not have enough balance to make this call! Please reload now.
Load
Enter Mobile Number: 09228545127
Amount: 100
Confirmation:
100 peso has been loaded to your account
Your current balance is 101.50
3. LINUX IV – WRITTEN
Exam should be accomplished using your own hand writing using ballpen of blue ink only.
Write your answers in a short bond paper (8x11); do not write at the back of the bond paper. Staple the bond
paper with this questionnaire, being the first page, before submitting it.
Write your printed name at the upper left side of every bond paper you’ve used and affix your signature on top of
the printed name.
Put it in a short brown envelope and write your name, course, and subject in front of the envelope.
Submit your exam papers personally on or before 10:00 P.M. of March 14, 2011, Monday. Time will be based on
the wall clock located at the stairway in ITCC.
Non-compliance with the above instructions would invalidate your exam and thus will require you to take the
special exam
Good luck and thank you for a wonderful semester!
Name: ___________________________________ LINUX IV – PERL PROGRAMMING
TEST II – WRITTEN
Write a program that reads a line of input and prints out the following:
• 11 if the line consists of a non-zero integer
• 00 if the line consists of 0 or a string
Suppose the value of $num is 2010. What string is assigned to $text in each of the following cases?
a $text = "This string contains $num.";
b $text = "$num is my favorite number.";
c $text = 'Assign $num to this string.';
What is the value of the following expressions?
a. 17 * 2 ** 3 / 9 % 2 << 2
b. 0 && (171567 * 98275 / 1174.5 ** 4)
c. 1171 ^ 904
d. "abc" . "de" x 2
Assume the following assignments have been performed:
@list = (1, 2, 3);
$scalar1 = "hello";
$scalar2 = "there";
What is assigned to the array variable @newlist in each of the following cases?
a. @newlist = @list;
b. @newlist = reverse(@list[1,2]);
c. @newlist = ($scalar1, @list[1,1]);
d. ($dummy, @newlist) = @list;
e. @newlist[2,1,3] = @list[1,2,1];
f. @newlist = <STDIN>;
Assume that the following assignments have been performed:
@list1 = (1, 2, 3, 4);
@list2 = ("one", "two", "three");
4. What is the value of $result in each of the following cases?
($dummy, $result) = @list1;
$result = @list1;
($result) = @list2;
($result) = @list1[1..2];
$result = $list2[$list1[$list1[0]]];
$result = $list2[3];