2023 Score 100 Name Student Number COMP 1920 Server side Web | Assignment Collections

Computer Science 2023 Computer Science Assignment – php

2023 Score 100 Name Student Number COMP 1920 Server side Web | Assignment Collections

 

 

Score:          /100

Name:

 

 

Student Number:

 

COMP 1920 Server-side Web Scripting with PHP

Final Exam — Fall Semester 2009

Time: 150 minutes (2 hours)

 

You did it!

 

Congratulations on making it through a relatively tough course!

 

If you do not understand the requirements of any portion of the exam, ask me.

 

There are 105 marks available on this exam, which is marked out of 100.

 

Please type your answers in this Microsoft Word document and submit it to SHARE IN

before 11:59pm Thursday, December 5.

 

To this folder: INCOMP1920finalexam

 

____________________________

Enjoy your winter.

I hope to see you in COMP2920.


  1. Lesson 1 (10 marks)

 

Write a script that prints out the following text to the screen exactly as shown:

Text Box: “Hey”, he said, “You still owe me ‘$5’ from \ that $50 I lent “last week””.

 

 

 

 

  1. Lesson 2 (10 marks)

 

Write a script that uses a loop to write the values 1 to 1000, one value per line. Inside the loop skip printing number 250, and determine if the next number to be written is 500. If it is, stop the loop.

 

 

 

 

  1. Lesson 3 (10 marks)

 

Write a PHP script that uses an array called $array to store the values of firstname and lastname that are sent by the following form.

 

<form action = “./lesson3.php” method = “get”>

      First name:     <input type = “text” name = “firstname”>

      Last name:     <input type = “text” name = “lastname”>

                              <input type = “submit”>

</form>

 

Write the code to add those values from the form to the end of the $array array. Then use a foreach loop to print out the values from $array.

 

 

 

 

  1. Lesson 4 (10 marks)

 

Write a PHP script that opens a text file called “lesson04.txt” for appending (or creates it if it does not yet exist); if there is a problem opening/creating the file, terminate the PHP script. Write the text “nCOMP2920 will be funn” to the text file, and close the file.

 

 

 

  1. Lesson 5 (10 marks)

 

Write a regular expression that matches only the following:

 

A street address that has the following pattern (in the following order):

 

An optional # sign                                                                                   e.g. “#”

1 to 5 digits (optional – apartment number)                                         e.g. “100”

an optional dash, which has an optional space on either side of it      e.g. “ – “

1 to 5 digits (street number)                                                                    e.g. “7777”

“th” or “st” or “nd” or “rd” (optional)                                                 e.g. “th”

At least one space                                                                                    e.g. “ “

“Street” or “street” or “Avenue” or “avenue” or “Ave” or “ave”     e.g. “Street”

 

Examples that meet the criteria:

“#100 – 7777th Street”

“100–7777        ave”

 

Examples that do not meet the criteria:

“abc100 – 7777 ave”

“100-7777 ave XYZ”

 

 

$regex = “                                                                                                                            “

 

 

  1. Lesson 6 (10 marks)

 

Write a PHP script that says “Welcome back” to the user if they have visited the site in the past 10 minutes. If the user has NOT visited in the past 10 minutes, tell them “Welcome to my Web site” and store a cookie that will remember them for 10 minutes. Use a cookie called “tenminutes”.

 

 

 

 

  1. Lesson 7 (10 marks)

 

Write a script that checks for the existence of a session variable called “lastname”. If the variable does not exist, tell the user “farewell” and terminate the script. If the variable does exist, print its value to the screen and create a session variable called “logged”, and set its value to true. Write all of the code necessary to make the script work.

 

 

 

 

  1. Lesson 8 (10 marks)

 

It is not easy to test graphics without using a reference guide. Instead, describe your favourite and least favourite parts of this course. Any thoughtful reply will earn top marks. Incomplete or unhelpful comments can earn zero marks.

 

 

 

  1. Lesson 9 (10 marks)

 

I have created a database account on a host called “blah.com”. You can connect to the host with username “tony” and password “comp1920”.

 

The database is called “information”. There is a table in this database called “names” with the following fields:

          firstname varchar(40)

          lastname varchar(40)

          middlename varchar(40)

          nickname varchar(40)

          username varchar(40)

 

Write a PHP script that connects to the database server, or dies if it cannot connect. Select the “information” database. Insert a record into the database.

 

 

 

  1. Lesson 10 (10 marks)

 

Continuing from question 9 (do not repeat that code here), write a script to list all of the records in the “names” table of the “information” database, sorted by nickname.

 

 

 

  1. Bonus Question (5 marks)

 

Your instructor likes to learn new things, too.

What is the meaning of life? Tell your instructor anything that makes him *think*. Any attempt at an honest answer will score full marks. Your instructor has learned lots of interesting things from students.

 

 

 

 

 

 

 

 

 

 

“Never again clutter your days or nights with so many menial and unimportant things that you have no time to accept a real challenge when it comes along. This applies to play as well as work. A day merely survived is no cause for celebration. You are not here to fritter away your precious hours when you have the ability to accomplish so much by making a slight change in your routine. No more busy work. No more hiding from success. Leave time, leave space, to grow. Now. Now! Not tomorrow!”  

          Og Mandino

 

 

 

 

 

Enjoy your winter; enjoy your life.

 

 

Jason 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational