Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Arrays, Movies, Films

Sambsquanch
Sambsquanch 


In the Java programming language. Create a Film class that holds on to information about a film. The film contains a unique ID number, title, copyright year, director, rating (following the Film Rating System), format (DVD, BlueRay, Digital, etc), and a likeability score. Scale for the score, 1 being the worst and 5 being the best. The program should ask a user to enter information about some films that they own. Store this information in an array of Films. Your user should be able to enter up to 100 films. After the user enters all the films that they own, you should display all the films as a list sorted by the user defined ranking (worst to best). Attachments
Tags Clarifications

Answers

Program

sudheer488
sudheer488 



You can enter the data upto 100 films.
Sample output is pasted
Attachments
Film.java (1 K) Download Preview
enter Director's name"); dir_name=br.readLine(); System.out.println(" enter films rating"); rate=br.readLine(); System.out.println(" enter films format"); form=br.readLine(); System.out.println(" enter score on scale of 1 to 5 1being worst and 5 being best"); scor=Integer.parseInt(br.readLine()); f[i] =new Film(i,name ,yr ,dir_name,rate,form,scor); } System.out.println("Unique ID \t

Film Output.PNG (25 K) Download Preview

Screenshots
Screenshot
Purchase Answer

Downpayment only

SW_wizard
SW_wizard 



As discussed - this is for downpayment only.
Answer will be uploaded separately.
Attachments
Screenshots
Purchase Answer

Modified Code

sudheer488
sudheer488 



Modified Code as per the new requirements.
Attachments
Driver.java (2 K) Download Preview
//Array to store upto 100 films data Film f[] = new Film[99]; Driver d = new Driver(); int limit; String name; int yr; String dir_name; String rate; String form; int scor; System.out.println(" enter the number of films you want

Screenshots
Purchase Answer

Complete program attached - Arrays Films

SW_wizard
SW_wizard 



Done as per the requirements
output screenshot also included
Attachments
ArraysFilms.zip (87 K) Download
Preview
public int compareTo(Film arg) { // TODO Auto-generated method stub int compareScore = ((Film) arg).score; return this.score - compareScore; //returns in ascending order (from worst to best) } public static Comparator<Film> FilmScoreComparator = new Comparator<Film>() { public int

Preview
}while(format.length() < 1); int score=0; do{ System.out.print("Enter film's like-ability score (from 1 through 5, 1-worst, 5-best): "); String y = input.nextLine(); //validate that entered value is number between 1 to 5 if(y.matches("[0-9]+")){ score = Integer.parseInt(y); } //validate score

Preview

Screenshots
Screenshot
Purchase Answer