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
bija089 [108]
1 year ago
10

Write, compile, and test the MovieQuoteInfo class so that it displays your favorite movie quote, the movie it comes from, the ch

aracter who said it, and the year of the movie: I GOT IT DONT WATCH AD.
class MovieQuoteInfo {
public static void main(String[] args) {
System.out.println("Rosebud,");
System.out.println("said by Charles Foster Kane");
System.out.println("in the movie Citizen Kane");
System.out.println("in 1941.");
}
}
Computers and Technology
1 answer:
Irina18 [472]1 year ago
7 0

Using the knowledge of computational language in JAVA it is possible to write a code that removes your favorite phrase from the movie. It consists of two classes in which one is driver code to test the MovieQuoteInfo class.

<h3>Writing code in JAVA:</h3>

<em>public class MovieQuoteInfo { //definition of MovieQuoteInfo class </em>

<em> //All the instance variables marked as private </em>

<em> private String quote;</em>

<em> private String saidBy;</em>

<em> private String movieName;</em>

<em> private int year;</em>

<em> public MovieQuoteInfo(String quote, String saidBy, String movieName, int year) { //parameterized constructor </em>

<em>  super();</em>

<em>  this.quote = quote;</em>

<em>  this.saidBy = saidBy;</em>

<em>  this.movieName = movieName;</em>

<em>  this.year = year;</em>

<em> }</em>

<em> //getters and setters </em>

<em> public String getQuote() {</em>

<em>  return quote;</em>

<em> }</em>

<em> public void setQuote(String quote) {</em>

<em>  this.quote = quote;</em>

<em> }</em>

<em> public String getSaidBy() {</em>

<em>  return saidBy;</em>

<em> }</em>

<em> public void setSaidBy(String saidBy) {</em>

<em>  this.saidBy = saidBy;</em>

<em> }</em>

<em> public String getMovieName() {</em>

<em>  return movieName;</em>

<em> }</em>

<em> public void setMovieName(String movieName) {</em>

<em>  this.movieName = movieName;</em>

<em> }</em>

<em> public int getYear() {</em>

<em>  return year;</em>

<em> }</em>

<em> public void setYear(int year) {</em>

<em>  this.year = year;</em>

<em> }</em>

<em> //overriden toString() to print the formatted data</em>

<em> public String toString() {</em>

<em>  String s = quote+",\n";</em>

<em>  s+="said by "+this.saidBy+"\n";</em>

<em>  s+="in the movie "+this.movieName+"\n";</em>

<em>  s+="in "+this.year+".";</em>

<em>  return s;</em>

<em> }</em>

<em>}</em>

<em>Driver.java</em>

<em>public class Driver { //driver code to test the MovieQuoteInfo class</em>

<em> public static void main(String[] args) {</em>

<em>  MovieQuoteInfo quote1 = new MovieQuoteInfo("Rosebud", "Charles Foster Kane", "Citizen Kane", 1941);//Create an object of MovieQuoteInfo class</em>

<em>  System.out.println(quote1); //print its details </em>

<em> }</em>

<em>}</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

You might be interested in
The set of coordinating colors applied to backgrounds, objects, and text in a presentation is called:
Sonja [21]

Answer:

theme colors

Explanation:

As said, a group of colors that are used to format text and objects in a document. When you open the Color menu, these colors determine what you see.

3 0
2 years ago
A college student needs a laptop that can be used while committing on the train and sitting in a lecture
Westkost [7]
You could get a laptop for like 200 that could run well and enough space for stuff.
4 0
3 years ago
What are the pros and cons of using the internet in a medical office setting?
konstantin123 [22]
Pros:
-They can share information between different medical offices quicker than they could before hand.
-It is cheaper to send information via the internet than it is to hand it by hand

Cons:
-Hackers can get access to the medical patient's information.
-The upkeep costsof the internet connection may lower their income.
7 0
2 years ago
What tool is included with windows 8 that will help you connect to the directaccess server when you have problems and can be use
Elina [12.6K]
None that I know. Many third party apps.
4 0
3 years ago
A combination lock has the following basic properties:
fomenos

Answer:

public class CombinationLock {

   

    private int combinationNumber1 = 0;

    private int combinationNumber2 = 0;

    private int combinationNumber3 = 0;

   

   CombinationLock(int combinationNumber1, int combinationNumber2, int combinationNumber3){

       this.combinationNumber1 = combinationNumber1;

       this.combinationNumber2 = combinationNumber2;

       this.combinationNumber3 = combinationNumber3;

   }

   

   public boolean open(int number1, int number2, int number3){

       if(number1 == combinationNumber1 && number2 == combinationNumber2 && number3 == combinationNumber3)

           return true;

       else

           return false;

   }

   

   public boolean changeCombo(int number1, int number2, int number3, int newNumber1, int newNumber2, int newNumber3){

       

       if (open(number1, number2, number3)){

           combinationNumber1 = newNumber1;

           combinationNumber2 = newNumber2;

           combinationNumber3 = newNumber3;

           return true;

       }else

           return false;

   }

}

Explanation:

- <em>Three variables</em> are created to hold the combination.

- A <em>constructor</em> is created to set the combination.

- A boolean method called <em>open</em> is created to check if the given numbers are correct, and <u>returns true</u> (<u>otherwise returns false</u>).

- A boolean method method called <em>changeCombo</em> is created to check if given numbers are correct. If they are correct, it assigns new values for the combination and <u>returns true</u> (<u>otherwise returns false</u>).

5 0
2 years ago
Other questions:
  • What computer has best software
    5·1 answer
  • At an open or uncontrolled intersection, yield if ____.
    15·2 answers
  • 1. In Access, a template is which of the following? a. A database to manage contacts b. Where a database is stored c. Two tables
    5·1 answer
  • An attacker compromises the Washington Post's web server and proceeds to modify the homepage slightly by inserting a 1x1 pixel i
    12·1 answer
  • Multiple Choice
    9·1 answer
  • Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combination
    8·1 answer
  • 1. Light of wavelength 900x10-9 m is emitted by a source. What is its frequency?​
    5·1 answer
  • Analog computers are general purpose computers : true ? or false ?​
    8·1 answer
  • Select the statements that are true regarding IP addresses. Check All That Apply assigned to your home network by your ISPassign
    13·1 answer
  • Would it be feasible to combine fixed length field and variable length field format in single disk
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!