Hoe do I fix the code: zyLabsUnitTest.java:20: error: no suitable constructor found for Movie(String,int,boolean,String[]) m = new Movie("Some Flick", 90, false, cast1); ^ constructor Movie.Movie() is not applicable (actual and formal argument lists differ in length) constructor Movie.Movie(String,int,boolean,int,String[]) is not applicable (actual and formal argument lists differ in length) zyLabsUnitTest.java:30: error: cannot find symbol answer = m.doArraysMatch(null, null); ^ symbol: method doArraysMatch(,) location: variable m of type Movie zyLabsUnitTest.java:36: error: cannot find symbol answer = m.doArraysMatch(cast1, null);

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hoe do I fix the code:

zyLabsUnitTest.java:20: error: no suitable constructor found for Movie(String,int,boolean,String[]) m = new Movie("Some Flick", 90, false, cast1);                                            ^

 constructor Movie.Movie() is not applicable (actual and formal argument lists differ in length) constructor Movie.Movie(String,int,boolean,int,String[]) is not applicable (actual and formal argument lists differ in length) zyLabsUnitTest.java:30: error: cannot find symbol answer = m.doArraysMatch(null, null);

  ^

symbol: method doArraysMatch(<null>,<null>) location: variable m of type Movie zyLabsUnitTest.java:36: error: cannot find symbol answer = m.doArraysMatch(cast1, null);

  ^

 symbol: method doArraysMatch(String[],<null>) location: variable m of type Movie zyLabsUnitTest.java:42: error: cannot find symbol answer = m.doArraysMatch(cast1, cast2);

  ^

 symbol: method doArraysMatch(String[],String[]) location: variable m of type Movie zyLabsUnitTest.java:48: error: cannot find symbol answer = m.doArraysMatch(cast1, cast3);

  ^

 symbol: method doArraysMatch(String[],String[]) location: variable m of type Movie zyLabsUnitTest.java:54: error: cannot find symbol answer = m.doArraysMatch(cast3, cast4);

  ^

 symbol: method doArraysMatch(String[],String[]) location: variable m of type Movie

Code:

import java.util.Arrays;

public class Movie {
 
 String movieName;
 int numMinutes;
 boolean isKidFriendly;
 int numCastMembers;
 String castMembers[] = new String[10];
 
 // Non-parameterized constructor
 public Movie() {
  this.movieName = "Flick";
  this.numMinutes = 0;
  this.isKidFriendly = false;
  this.numCastMembers = 0;
 }
 
 // Parameterized constructor
 public Movie(String movieName, int numMinutes, boolean isKidFriendly, int numCastMembers, String[] castMembers) {
  this.movieName = movieName;
  this.numMinutes = numMinutes;
  this.isKidFriendly = isKidFriendly;
  this.numCastMembers = numCastMembers;
  this.castMembers = castMembers;
 }
 
 // getter and setters
 public String getMovieName() {
  return movieName;
 }

 public void setMovieName(String movieName) {
  this.movieName = movieName;
 }

 public int getNumMinutes() {
  return numMinutes;
 }

 public void setNumMinutes(int numMinutes) {
  this.numMinutes = numMinutes;
 }

 public boolean isKidFriendly() {
  return isKidFriendly;
 }

 public void setKidFriendly(boolean isKidFriendly) {
  this.isKidFriendly = isKidFriendly;
 }

 public int getNumCastMembers() {
  return numCastMembers;
 }

 public void setNumCastMembers(int numCastMembers) {
  this.numCastMembers = numCastMembers;
 }

 public String[] getCastMembers() {
  return castMembers;
 }

 public void setCastMembers(String[] castMembers) {
  this.castMembers = castMembers;
 }
 
 public String toString() {
  return "Movie name: "+movieName+"\n Num Minutes: "+numMinutes+"\nIs Kid Friendly: "+isKidFriendly+"\nNum cast memebers: "+numCastMembers+"\nCast Members: "+Arrays.toString(castMembers);
 }
 
 //Main funtion
 public static void main(String args[]) {
  
  //Printing default values
  System.out.println("-----------------------Default values------------------------");
  Movie m = new Movie();
  System.out.println(m);
  //printing setter new value
  String castMembers[] = {"Ram", "Charan", "Swami","Ganesh","Namita","Babita","Anunay","Shikhar","Dravin","peter"};
  Movie movie = new Movie("Avengers End game", 150, true, 25, castMembers);
  System.out.println("------------------------New setter values------------------");
  System.out.println(movie);
  
 }

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY