1 / 6

HW 4 Strings

HW 4 Strings. INFSCI 1059. HW 4 Strings. HW4 Part 1: When you click on the following link http:// www.sis.pitt.edu/~ perkoski/is1092/Homework/answers/HW4/Strings/bobWebPage.php you will attempt to run bobWebPage.php but as you can see it fails. Here is the link to bobWebPage.txt:

Download Presentation

HW 4 Strings

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HW 4 Strings INFSCI 1059

  2. HW 4 Strings • HW4 Part 1: • When you click on the following link http://www.sis.pitt.edu/~perkoski/is1092/Homework/answers/HW4/Strings/bobWebPage.php you will attempt to run bobWebPage.php but as you can see it fails. Here is the link to bobWebPage.txt: • http://www.alladinacademy.com/is1059/Homework/HW4/bobWebPage.txt • which displays the code. • Correct the code by “fixing” the string so *your* version of bobWebPage.php runs and displays my homepage. It should look like this when you run your php file: http://www.sis.pitt.edu/~perkoski/ • Now, do not view source from the immediately previous link and cut and paste - it will not work properly due to relative path links to images. Work with the string in bobWebPage.txt • Post your own bobWebPage.php and bobWebPage.txt files.

  3. HW4 Strings • HW4 Part 2 • After fixing the string in bobWebPage.php create a new file called bobWebPage2.php and copy all of your code into it. Delete your echo statement. • Each section below must be implemented in FUNCTIONS!!! • If you can’t get something to work – simply echo in your function something like “Unable to complete” and comment out the bad code – DON’T STOP YOUR PROGRAM • Write a function that searches for any occurrences of “INFSCI” and changes them to “Information Science” • Write a function that extracts the Cascading Style Sheet starting with <style> and ending with </style> • Display the style sheet – not just use view source to see it. • Post your bobWebPage2.php and bobWebPage2.txt

  4. HW4 Strings • HW4 Part 3 • Click on the link http://www.alladinacademy.com/is1059/Homework/HW4/baseball.txt • There you will find a long string named $baseballString. This is what you will use in the next assignments. • Create a php file called baseball.php • Add the long $baseballString to your file • Write the following functions:

  5. HW 4 Strings • Write a function that prints out the number of words. Output: The number of words in $baseballString is ANSWER. • Write a function that prints out the last 119 characters of the string. Output: The last 119 chars of $baseballString are ANSWER. • Write a function that displays the character position of the substring .393 • Write a function that displays the character position of the substring .00728

  6. HW4 Strings • Write a function that prints out on a separate line each team and their stats. Start each line with the name of the team. • Post your baseball.php and baseball.txt files

More Related