Learn to Code
John F. Dumas
contact me | resume | how it works | example programs | testimonials | main page
PHP - Godzilla And Star Trek
► Problem Description: There are two parts to this problem. First, read in the 'all.txt' file we created in example one. Find all entries that contain the string "godzilla" (case insensitive) and then output a table, sorted from highest rank to lowest rank. Show the following information:
average-rating number-of-ratings year title
For the second part you are to create a table as we did above, sorted from highest to lowest rank but this time, we want to use the Star Trek movies. Here are the names of the movies to use:
Star Trek: The Motion Picture Star Trek II: The Wrath of Khan Star Trek III: The Search for Spock Star Trek IV: The Voyage Home Star Trek V: The Final Frontier Star Trek VI: The Undiscovered Country Star Trek: Generations Star Trek: First Contact Star Trek: Insurrection Star Trek: Nemesis
Use the same table format as used above for the Godzilla movies
► Example Output: Here's what the output should look like.
Godzilla Movies
Rating | Number Of Ratings | Year | Title |
3.67 | 470 | 1993 | Godzilla vs. Mechagodzilla II |
3.65 | 791 | 2002 | Godzilla Against Mechagodzilla |
3.62 | 371 | 1974 | Godzilla vs. Mechagodzilla |
3.56 | 429 | 2003 | Godzilla: Tokyo S.O.S. |
3.55 | 447 | 1966 | Godzilla vs. The Sea Monster |
3.54 | 1088 | 2001 | Godzilla, Mothra and King Ghidorah: Giant Monsters All Out Attack |
3.54 | 709 | 2000 | Godzilla vs. Megaguirus |
3.50 | 327 | 1971 | Godzilla vs. Hedorah |
3.46 | 311 | 1972 | Godzilla vs. Gigan |
3.39 | 877 | 1995 | Godzilla vs. Destroyah / Godzilla vs. Space Godzilla (Double Feature) |
3.33 | 974 | 1991 | Godzilla & Mothra: Battle for Earth / Vs. King Ghidora |
3.32 | 308 | 1967 | Son of Godzilla |
3.27 | 1033 | 1956 | Godzilla: King of the Monsters |
3.22 | 916 | 1964 | Godzilla vs. Mothra |
3.05 | 450 | 1975 | Terror of Mechagodzilla |
3.03 | 155 | 2004 | Godzilla: The Series: Monster Wars Trilogy |
2.78 | 184 | 1999 | Godzilla And Other Movie Monsters |
2.76 | 1926 | 1999 | Godzilla 2000: Millennium |
2.74 | 18882 | 1998 | Godzilla |
2.70 | 313 | 1969 | Godzilla's Revenge |
Star Trek Movies
Rating | Number Of Ratings | Year | Title |
3.83 | 37880 | 1982 | Star Trek II: The Wrath of Khan |
3.77 | 35367 | 1996 | Star Trek: First Contact |
3.71 | 23342 | 1986 | Star Trek IV: The Voyage Home |
3.63 | 22170 | 1991 | Star Trek VI: The Undiscovered Country |
3.62 | 20663 | 1994 | Star Trek: Generations |
3.60 | 23764 | 1984 | Star Trek III: The Search for Spock |
3.55 | 26927 | 1998 | Star Trek: Insurrection |
3.44 | 36519 | 2002 | Star Trek: Nemesis |
3.43 | 20487 | 1979 | Star Trek: The Motion Picture |
3.32 | 24190 | 1989 | Star Trek V: The Final Frontier |
► Source code