1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
bonufazy [111]
3 years ago
12

Write a class named Episode. An instance of this episode class will represent a single episode of a TV show, with a title, a sea

son number, and an episode number. For example "Friends, season 1, episode 1", or "The Wire, season 3, episode 5." Your class should have the following constructors and methods: A constructor that accepts three arguments: a String for the title, an int for the season number, and an int for the episode number. A constructor that accepts only a String, for the title, and sets the season and episode numbers to 1. A setter and getter for the title. (never mind the season and episode numbers.) A method named "equals", that accepts an Episode, and returns true if the title, season number and episode number are the same as the receiving object's. A method named "comesBefore". This method should also accept an Episode. It should return true if the episode that receives the invocation comes before the parameter. That is only true if the two objects have the same title, and if the argument comes from a later season, or the same season, but a later episode. Write only the class. Do not write a whole program
Computers and Technology
1 answer:
gavmur [86]3 years ago
7 0

Answer:

See explaination

Explanation:

class Episode{

//Private variables

private String title;

private int seasonNumber;

private int episodeNumber;

//Argumented constructor

public Episode(String title, int seasonNumber, int episodeNumber) {

this.title = title;

this.seasonNumber = seasonNumber;

this.episodeNumber = episodeNumber;

}

//Getter and setters

public String getTitle() {

return title;

}

public void setTitle(String title) {

this.title = title;

}

public int getSeasonNumber() {

return seasonNumber;

}

public void setSeasonNumber(int seasonNumber) {

this.seasonNumber = seasonNumber;

}

public int getEpisodeNumber() {

return episodeNumber;

}

public void setEpisodeNumber(int episodeNumber) {

this.episodeNumber = episodeNumber;

}

public boolean comesBefore(Episode e){

//Check if titles' match

if(this.title.equals(e.getTitle())){

//Compare season numbers

if(this.seasonNumber<e.seasonNumber){

return true;

}

//Check if season numbers match

else if(this.seasonNumber==e.getSeasonNumber()){

return this.episodeNumber<e.getEpisodeNumber();

}

}

return false;

}

atOverride // replace the at with at symbol

public String toString() {

return title+", season "+seasonNumber+", episode "+episodeNumber;

}

}

class Main{

public static void main(String[] args) {

Episode e = new Episode("Friends",1,1);

System.out.println(e);

Episode e2 = new Episode("The Wire",3,5);

System.out.println(e2);

System.out.println(e.getTitle()+" comes before "+e2.getTitle()+" = "+e.comesBefore(e2));

}

}

You might be interested in
"If someone really wants to get at the information, it is not difficult if they can gain physical access to the computer or hard
Jobisdone [24]

Answer:

It is  just true in most cases

Explanation:

This statement is just true in most cases because in some cases having a physical access to the computer or hard drive this does not guarantee access to the information contained in the hard drive or computer because the data/information in the hard drive or computer might as well be encrypted and would require a password in order to de-crypt the information.

Having a physical access is one step closer in some cases but not the only step required .

4 0
3 years ago
A network administrator plugs a new pc into a switch port. the led for that port changes to solid green. what statement best des
gayaneshka [121]

The port is operational and ready to transmit packets.

<h3>What is transmission mode explain?</h3>

Transmission mode refers to the mechanism of transferring of data between two. devices connected over a network. It is also called Communication Mode. These. modes direct the direction of flow of information.

<h3>What is used to transfer data packets?</h3>

A router is a networking device that forwards data packets between computer networks. Routers perform the traffic directing functions on the Internet.

To learn more about Transmission mode, refer

brainly.com/question/18590710

#SPJ4

3 0
2 years ago
Question 1 (10 points)
lisabon 2012 [21]

Answer:

Find and replace header and footer

5 0
3 years ago
In BitTorrent, suppose Alice provides chunks to Bob throughout a 30-second interval. Will Bob necessarily return the favor and p
MakcuM [25]

Answer:

It will not necessary that bob will provide chunks to Alice.

Explanation:

Alice has four neighbors of Bob so he will send message to her, but this might not occur if Alice provides chunks to Bob.

Overlay is the network that build at the top of other network.It is a telecommunication network that supported by its own infrastructure.

It encapsulates one packet inside an other packet.

It is a method of creating layers of network that can be used to run multiple virtualized layers on the top pf other network.

It provides new security benefits.

Does Overlay include Routers

Overlay is a file sharing system in which nodes participating and create logical links between them.So overlay network does not include routers.

Edge in overlay

 It is a logical network in which nodes are connected using virtual or logical links.

5 0
3 years ago
What are some recent inventions that have improved the quality of your life?
Eva8 [605]
Phones, they help me with school work and provide entertainment.
4 0
3 years ago
Other questions:
  • A ___________ is an algorithm for which it is computationally infeasible to find either (a) a data object that maps to a pre-spe
    5·1 answer
  • Explain three applications of data mining
    14·1 answer
  • Which ORDER BY clause causes 10 rows to be retrieved from the result set, starting with the 20th row?
    5·1 answer
  • How do medical detectives investigate their cases?
    15·2 answers
  • You want to chart your daily water intake over the next three months. Which type of chart would be best for this purpose? Line P
    6·1 answer
  • What output is produced by
    10·1 answer
  • From a neural network with 11 input variables, one hidden layer with three hidden units, and one output variable, how many param
    7·1 answer
  • Brainly app won't let me watch ads anymore. I search my question and there is no skip button to watch an ad it only makes me buy
    7·2 answers
  • What is the first thing you should do when you discover a computer is infected with malware? The second thing?
    7·1 answer
  • A __________ is a thorough examination of each aspect of a network to determine how it may be compromised.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!