Question
Re-posting part of the question in which I did not get the right answer. A musician is producing a catalogue of sheet music (printed music)
Re-posting part of the question in which I did not get the right answer.
A musician is producing a catalogue of sheet music (printed music) she has collected over a number of years. She is writing a java application to help her keep track of the origins and reference numbers she has allocated to each piece of music. The following is an incomplete class definition to represent a piece of sheet music.
public class SheetMusic
{
private String title;
private String author;
private String reference;
public SheetMusic (String title, String author, String reference)
{
this.title = title;
this.author = author;
this.reference = reference;
}
/**
* search title for some words, return true
* or false
*/
public boolean titleMatch (String text)
{
// to be completed
}
}
The class SheetMusic records details for a piece of music in the catalogue. The method titleMatch is incomplete.
a) Write appropriate accessor methods for the title, author and reference fields.
b) Complete the body of the titleMatch method. The method should return true if the title of the music contains the text parameter, and false otherwise.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started