Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class filmRatings {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- String films [] = {"Titanic", "Mr. Popper's Penguins", "2001: A Space Odyssey", "Funny Face", "Indiana Jones and the Raiders of the Lost Ark", "Water for Elephants", "One Flew Over the Cuckoo's Nest", "Twilight: New Moon", "Hotel Transylvania", "The Life and Death of Peter Sellers"};
- String director [] = {"James Cameron", "Mark Waters", "Stanley Kubrick", "Stanley Donen", "Steven Spielberg", "Francis Lawrence", "Milos Forman", "Chris Weitz", "Genndy Tartakovsky", "Stephen Hopkins"};
- String releaseYear [] = {"1997", "2011", "1968", "1957", "1981", "2011", "1975", "2009", "2012", "2004"};
- int score [] = {10, 4, 5, 7, 8, 8, 4, 2, 4, 9};
- rating(films, director, releaseYear, score);
- } //main ends here
- static void rating(String[] films, String[] director, String[] releaseYear, int[] score)
- {
- for(int i=0; i<score.length; i++)
- {
- if(score[i]<5)
- {
- System.out.println(films[i] + " by " + director[i] + ", " + releaseYear[i] + ". Rating: " + score[i] + "/10. A bad lame film never to be seen again");
- }
- else if(score[i]>=5)
- {
- System.out.println(films[i] + " by " + director[i] + ", " + releaseYear[i] + ". Rating: " + score[i] + "/10. A great film that should be seen more than once");
- }
- }
- }
- } //class ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement