Created
October 6, 2015 13:23
-
-
Save CarlosCorderoSaavedra/0ded541b93f31fb377af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class ListOfPictures | |
{ | |
public static void main(String[] args) | |
{ | |
ArrayList<Picture> gallery = new ArrayList<Picture>(); | |
gallery.add(new Picture("degas1.jpg")); | |
gallery.add(new Picture("gaugin1.jpg")); | |
gallery.add(new Picture("monet1.jpg")); | |
gallery.add(new Picture("monet2.jpg")); | |
gallery.add(new Picture("renoir1.jpg")); | |
// Your code here | |
int count = 0; | |
for(Picture pic : gallery){ | |
if(pic.getHeight() > pic.getWidth()){ | |
count++; | |
} | |
} | |
System.out.println("Pictures with portrait orientation: " + count); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment