-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilmApp.java
More file actions
41 lines (33 loc) · 1.64 KB
/
Copy pathFilmApp.java
File metadata and controls
41 lines (33 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner;
public class FilmApp {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Scanner num = new Scanner(System.in);
String title;
String producer;
int yearProduce;
double productionCost;
System.out.println("Enter the title of the film : ");
title = sc.nextLine();
System.out.println("Enter the producer of said film : ");
producer = sc.nextLine();
System.out.println("Enter the year it was released : ");
yearProduce = num.nextInt();
System.out.println("Enter the film's production cost : ");
productionCost = num.nextDouble();
Film film1 = new Film(title, producer, yearProduce, productionCost);
Film film2 = new Film(film1);
film2.setProductionCost(film2.getProductionCost()*1.05);
film2.setTitle("Jumanji");
if(film2.filmAge()>=5)
System.out.println("The film "+film2.getTitle()+" had already reached 5 years of production age");
else if(film2.filmAge()<5)
System.out.println("The film "+film2.getTitle()+" has not yet reached 5 years of production age");
if(film1.moreExpensive(film1.productionCost, film2.productionCost))
System.out.println("The film "+film1.getTitle()+" is more expensive than "+film2.getTitle());
else if(film1.moreExpensive(film2.productionCost, film1.productionCost))
System.out.println("The film "+film2.getTitle()+" is more expensive than "+film1.getTitle());
sc.close();
num.close();
}
}