CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Can anybody help me in solving these questions? PLZ

 



aadi
New User

Aug 25, 2006, 8:41 AM

Post #1 of 5 (3187 views)
Can anybody help me in solving these questions? PLZ Can't Post

Can anybody help me in solving these questions. I need solutions. PLZ Question 1

Consider the following games.xml document.

<?xml version = "1.0"?>

<!-- games.xml -->

<!-- Sports Database -->

<sports>

<game id = "783">

<name>Cricket</name>

<paragraph>

Popular in Commonwealth nations.

</paragraph>

</game>

<game id = "239">

<name>Baseball</name>

<paragraph>

Popular in America.

</paragraph>

</game>

<game id = "418">

<name>Soccer (Football)</name>

<paragraph>

Popular sport in the world.

</paragraph>

</game>

</sports>



i. Write a suitable Document Type Definition file, games.dtd, against which games.xml can be validated. [5 pts]

ii. What is the correct XML Processing Instruction for the inclusion of games.dtd in games.xml? [5 pts]

iii. Write suitable XSL code for transforming games.xml into games.html. games.html must be an HTML file that displays the contents of games.xml in the form of a table as shown below. The XSL code must be stored in games.xsl file.

[10 pts]





iv. What is the correct XML Processing Instruction for the inclusion of games.xsl in games.xml? [5 pts]



Question 2

a) Good websites will always have a visible hit/visitor counter that saves as testament as to how popular the site is. Write a simple Perl script that implements a hit/visitor counter, visi-count.pl. This script must display the count in the form of a single-row, multi-column table with each cell containing a single digit of the count. Each cell must have a different-coloured digit, e.g. [20 pts]

b) Give the correct Server-Side-Include (SSI) command for the inclusion of visi-count.pl on an HTML web page. [5 pts]

Question 3

Write a Perl program county.pl that creates a named scalar variable called $counties with a value of Dublin, Kerry, Killkenny, Offaly, Cork, Waterford, Wexford, Laoise, Clare”. Using all the Perl techniques that you have learnt, your program must also do the following.

i. Search for a county in $counties that ends in in and store it as the first element in array @gaa_winners

ii. Search for a county whose name begins with C and ends with K and store this as the next element in array @gaa_winners

iii. Find all counties with names beginning with K or ending in Y and add them to the array @gaa_winners.

iv. The contents of array @gaa_winners must be written into an XML file, county.xml with the following structure. All county names must be in lower case!!!

<counties>

<county>

<name>dublin</name>

</county>

<county>

<name>killkenny</name>

</county>

……

…..

</counties> [25 pts]


Question 4

a) Draw a diagram that shows the Client/Server set-up for a MySQL database, Apache web server, Perl/CGI script and a compatible web browser. Explain briefly how each of these components behaves in this environment. How does one connect to a MySQL database using Perl? Give a small example. [5 pts]b) GCMS maintains a member register in a MySQL Database called REGISTER. The following details are maintained in a relation called members.i. First nameii. Last nameiii. Emailiv. Phone, of the form +(dd)-(dd)-ddd dddd, where d is a digitv. Usernamevi. Password Assume the following SQL statements were used to create the members relation.DROP TABLE IF EXISTS `members`;CREATE TABLE `members` ( `firstname` varchar(15) NOT NULL default '', `lastname` varchar(15) NOT NULL default '', `email` varchar(30) NOT NULL default '', `phone` varchar(14) NOT NULL default '', `username` varchar(15) NOT NULL default '', `password` varchar(10) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1; 1. Write HTML code for a registration form to collect a new member’s details and save them in the register database. [5 pts]2. Write a Perl/CGI script to process the data. The CGI script must generate an HTML page acknowledging the registration [15 pts] Question 5a) For the register database in question 4 (b), 1. Write an HTML page that accepts a member’s login details, i.e. username and password [5 pts]2. Write a Perl/CGI script that processes the login data and generates appropriate HTML messages if username and password are validif username and password are invalid [15 pts]

b) Compare and contrast the use of the bgsound and embed tags for the inclusion of sound on a web page. [5 pts]
Attachments: Assignement.doc (240 KB)


d1zz13
User

Aug 25, 2006, 9:11 AM

Post #2 of 5 (3184 views)
Re: [aadi] Can anybody help me in solving these questions? PLZ [In reply to] Can't Post

You mean can we take your exam for you?... NO Wink

Regards
Rich

If it aint broke then don't try to fix it


KevinR
Veteran


Aug 25, 2006, 9:27 AM

Post #3 of 5 (3181 views)
Re: [d1zz13] Can anybody help me in solving these questions? PLZ [In reply to] Can't Post


In Reply To
You mean can we take your exam for you?... NO Wink


I second the motion. Tongue
-------------------------------------------------


KevinR
Veteran


Aug 25, 2006, 9:30 AM

Post #4 of 5 (3181 views)
Re: [d1zz13] Can anybody help me in solving these questions? PLZ [In reply to] Can't Post

It is tempting though to supply you with some exceptionally wrong answers... Cool
-------------------------------------------------


d1zz13
User

Aug 28, 2006, 3:30 AM

Post #5 of 5 (3170 views)
Re: [aadi] Can anybody help me in solving these questions? PLZ [In reply to] Can't Post

Adnan,

You emailed me saying this was an assignment prior to your exam, and you got half marks as there was a lot of mistakes. If you got half marks, you must have done something?

If you post the code you came up with, maybe in a new topic for each of the questions, (In the Beginners forum, not the Advanced) then people will be more willing to help you as it shows that you want to learn and have made a start, however, they won't write the code for you. We'll probably come up with the odd snippets of code and point you in the right direction with the rest.

Regards
Rich

If it aint broke then don't try to fix it

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives