TestMovie4.java - By Cole Hudson Date Purpose Use merge...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * By Cole Hudson * Date: 4/12/2015 * Purpose: Use merge sort to sort movies by title, year, and studio. * * PMR in README.txt */ public class TestMovie4 { public static void main(String[] args) { //array of movies Movie4[] myMovies = { new Movie4("The Muppets Take Manhattan", 2001, "Columbia Tristar"), new Movie4("Mulan Special Edition", 2004, "Disney"), new Movie4("Shrek 2", 2004, "Dreamworks"), new Movie4("The Incredibles", 2004, "Pixar"), new Movie4("Nanny McPhee", 2006, "Universal"), new Movie4("The Curse of the Were‐Rabbit", 2006, "Aardman"), new Movie4("Ice Age", 2002, "20th Century Fox"), new Movie4("Lilo & Stitch", 2002, "Disney"), new Movie4("Robots", 2005, "20th Century Fox"), new Movie4("Monsters Inc", 2001, "Pixar") }; //original System.out.println("Before Sorting: "); printMovies(myMovies); System.out.println(); int maxArray = myMovies.length - 1; //title ascending System.out.println("Sorted by Title - ascending:"); sortTitles(myMovies, 0, maxArray, 1); printMovies(myMovies); System.out.println(); //year descending System.out.println("Sorted by Year - descending"); sortYears(myMovies, 0, maxArray, 2); printMovies(myMovies); System.out.println(); //studio ascending System.out.println("Sorted by Studio - ascending:");
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern