Chris Pollett > Old Classes > PIC40 ( Print View ) Lecture Notes-PDF Spring '01 Ad: Enrollment info Course Info:
Practice Exams: PIC: |
HW#2 --- last modified January 16 2019 00:35:22..Due date: noon Jan.29 ========= Files to be submitted: p40hw2file1.html -- contains the <frameset> ====================== for your frames document. p40hw2file2.html -- contains the left hand frame with the index p40hw2file3.php -- contains the content part of your document. p40hw2file4.pl -- favourite animal frequency program. Put all files in your \SUBMIT folder. You do not need to do anything on the UNIX side. HW2 Purpose: (1) To learn about frames and indexing within a document ============ (2) To gain familiarity with the basic constructs of Perl. i.e., variables, arrays, hashes, control structures, and a little bit of regular expressions. Specification: ============== For the first part of this homework you are going to write (again not using a web document tool like Composer) an HTML document that uses frames. Your document should have two frames: a left hand and right hand frame. The left hand frame should take up 30% of the screen width and the right hand side should fill up the remaining width. Both frames should be scrolling. The left-hand frame should have centered at its top (use an inline style) an h3 headline saying: "Index". The right hand frame should have centered at its top an h1 headline: "The Wily Platypus". The right document should be split into four paragraphs each procceeded with an h3 headline (left-aligned) and a naming anchor. These headlines are: Introduction, Gestation, Pluralizing Platypus, and Avoiding Platypus Attacks. You can fill these paragraphs with whatever amusing content you can think of. Each paragraph should pretty much fill a browser screen. The left hand frame should have a link to the naming anchor of each paragraph within the right hand side and these links should target the right hand frame. Finally, the left hand frame should have a link to some other platypus site on the web and its target should be _top. The second part of the homework involves writing your first Perl program. This program should let the user enter people's first names followed by a space followed by a favourite animal. This might look like: Please enter some people's names followed by a space followed by their favourite animal. Hit ^D when done. Bob emu Alice tiger Jane emu ^D It then prints out each animal in alphabetical order together with all the people who liked it. The people should be sorted too. For example: emu: Bob Jane tiger: Alice Notice each animal is only printed once. Your program should use at least one foreach loop and make constructive uses of both an array and a hash. Point Breakdown for HW2 ======================= How well your code is commented........1pt Frames appear as described above.......1pt 1st four links in left hand side target correct part of right hand doc......1pt Last link targets _top.................1pt Perl program accepts input correctly...1pt Perl program outputs data correctly....1pt Uses a foreach loop....................1pt Uses both an array and a hash..........1pt Total..................................8pts |