-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMedia.java
More file actions
81 lines (68 loc) · 2.03 KB
/
Media.java
File metadata and controls
81 lines (68 loc) · 2.03 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Declaring a class called Media
public class Media
{
// Declaring a private variable to store the media's title
private String titleOfMedia;
// Declaring a private variable to store the media's genre
private String genreOfMedia;
// Declaring a private variable to store the media's review
private String reviewOfMedia;
// Declaring a private variable to store the media's rating
private double ratingOfMedia;
// Constructor to set the values of the instance variables
Media(String theTitle, String theGenre, String theReview, double theRating)
{
this.titleOfMedia = theTitle;
this.genreOfMedia = theGenre;
this.reviewOfMedia = theReview;
this.ratingOfMedia = theRating;
}
// Default constructor to set the values of the instance variables
Media()
{
this.titleOfMedia = "";
this.genreOfMedia = "";
this.reviewOfMedia = "";
this.ratingOfMedia = 0.0;
}
// Set method to set the value of the title instance variable
public void setTitle(String newTitle)
{
this.titleOfMedia = newTitle;
}
// Set method to set the value of the genre instance variable
public void setGenre(String newGenre)
{
this.genreOfMedia = newGenre;
}
// Set method to set the value of the review instance variable
public void setReview(String newReview)
{
this.reviewOfMedia = newReview;
}
// Set method to set the value of the rating instance variable
public void setRating(double newRating)
{
this.ratingOfMedia = newRating;
}
// Get method to return the value of the title instance variable
public String getTitle()
{
return this.titleOfMedia;
}
// Get method to return the value of the genre instance variable
public String getGenre()
{
return this.genreOfMedia;
}
// Get method to return the value of the review instance variable
public String getReview()
{
return this.reviewOfMedia;
}
// Get method to return the value of the rating instance variable
public double getRating()
{
return this.ratingOfMedia;
}
}