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]
2 years 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]2 years 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
What can be designed to create annoying glitches or destroy data
Katen [24]

I guess the best answer is Virus.

Virus is a malicious computer program that is designed to create annoying glitches or destroy data.

3 0
2 years ago
Read 2 more answers
toThePowerOf is a method that accepts two int arguments and returns the value of the first parameter raised to the power of the
inessss [21]

Answer:

cubeVolume = toThePowerOf(cubeSide, 3)

Explanation:

The function toThePowerOf, receives two int arguments say, a and b, where a is the first argument and b is the second argument as follows:

toThePowerOf(a,b)

The function returns the first argument(a) raised to the power of the second argument (b) i.e a ^ b as follows:

toThePowerOf(a, b){

return a^b

}

In the call to the function, the first argument a, is replaced with the variable cubeSide and the second argument b is replaced with the value 3.

Hence, the returned result becomes cubeSide ^ 3 which is then stored in a variable cubeVolume as follows:

cubeVolume = toThePowerOf(cubeSide, 3)

6 0
3 years ago
Consider the recursive method myprint in this code snippet: public void myprint(int n) { if (n &lt; 10) { system.out.print(n); }
valkas [14]
What the method does, is it takes the rightmost decade and prints it, then divides by 10 and repeats. Effectively this means the number is printed backwards, so the output is 128.
7 0
3 years ago
2. As you have learned, ironically, a large part of sound production involves visual perception. How easy or difficult did you f
Alex787 [66]

Answer: it is very easy to work with programs such as audacity, they are real game changers. Also, they are very helpful for editing and recording audio. They could make audacity’s auto tune more beginner friendly

3 0
2 years ago
Two fingers are assigned to six letters each. What fingers are they?
Lena [83]

Answer:

The left and right index finger

Explanation:

Left index finger: R, T, F, G, C, V

Right index finger: Y, U, H, J, B, N

8 0
3 years ago
Other questions:
  • What will be the output of “AAAAMMMMMHHHVV” using a file compression technique?
    9·2 answers
  • Use this option to view your presentation as your audience will see it. a.File menu b.Play button c.Slide Show button d.Tools me
    6·2 answers
  • Consider the concept of cultural lag. Identify two American values that are “lagging.” What are three norms that are lagging? Ho
    11·1 answer
  • How can i take out a random (double) number in between 5.0 to 15.0 in c++?
    7·1 answer
  • What is a Better Computer?<br> A. Alien<br> B. Microsoft<br> C. Windows<br> D. Apple
    11·2 answers
  • A ______ is an exact duplication of the hard drive, including data files, system files, and settings, application files, and the
    15·1 answer
  • Assume you have an Access database with five different tables, including various pieces of information about your client base. Y
    9·1 answer
  • Describe your WGU program, including two specific requirements that this degree has for completion.
    14·1 answer
  • when you sent email your email can be set to automatically keep a copy where do you find these copies​
    13·1 answer
  • If you double the force of and object what happens to the acceleration
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!