perl take home final exam
DESCRIPTION
Take Home Final Exam of 4CS and 4ITTRANSCRIPT
![Page 1: Perl take home final exam](https://reader036.vdocuments.us/reader036/viewer/2022082808/5562f7b1d8b42a275f8b476e/html5/thumbnails/1.jpg)
Linux IV – Perl ProgrammingTake Home - Final ExaminationLINUX 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 Menu1. View account Balance2. Share-A-Load3. Load4. Text5. Call6. ExitChoice:
Conditions:The following are the conditions for call and text options:
- the user could only text if he/she has at lest 1 peso loado if the account has less than 1 peso, then the message “Message Sending Failed!” will be displayedo 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 BalanceYour account balance as of today is 12.50
Share-A-LoadEnter Mobile Number: 09228545127Amount: 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
TextEnter Mobile Number: 09228545127Message: Congratulations Pare!
![Page 2: Perl take home final exam](https://reader036.vdocuments.us/reader036/viewer/2022082808/5562f7b1d8b42a275f8b476e/html5/thumbnails/2.jpg)
Confirmation:Message has been successfully sent
CallEnter Mobile Number: 09228545127
Confirmation:Your do not have enough balance to make this call! Please reload now.
LoadEnter Mobile Number: 09228545127Amount: 100
Confirmation:100 peso has been loaded to your accountYour current balance is 101.50
![Page 3: Perl take home final exam](https://reader036.vdocuments.us/reader036/viewer/2022082808/5562f7b1d8b42a275f8b476e/html5/thumbnails/3.jpg)
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 << 2b. 0 && (171567 * 98275 / 1174.5 ** 4)c. 1171 ^ 904d. "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");
![Page 4: Perl take home final exam](https://reader036.vdocuments.us/reader036/viewer/2022082808/5562f7b1d8b42a275f8b476e/html5/thumbnails/4.jpg)
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];