Respuesta :
Solution :
a.
public Book([tex]$\text{String title}$[/tex], String author, [tex]$\text{String publisher}$[/tex], int [tex]$\text{copiesSold}$[/tex]) {
this.[tex]$\text{title}$[/tex] = [tex]$\text{title}$[/tex];
this.[tex]$\text{author}$[/tex] = [tex]$\text{author}$[/tex];
this.[tex]$\text{publisher}$[/tex] = [tex]$\text{publisher}$[/tex];
this.[tex]$\text{copiesSold}$[/tex] = [tex]$\text{copiesSold}$[/tex];
b). [tex]$\text{public String}$[/tex] getTitle() {
return [tex]$\text{title}$[/tex];
}
[tex]$\text{public void}$[/tex] setTitle([tex]$\text{String title}$[/tex]) {
this.[tex]$\text{title}$[/tex] = [tex]$\text{title}$[/tex];
}
[tex]$\text{public String}$[/tex] getAuthor() {
return author;
}
[tex]$\text{public void}$[/tex] setAuthor(String author) {
this.[tex]$\text{author}$[/tex] = [tex]$\text{author}$[/tex];
}
[tex]$\text{public String}$[/tex] getPublisher() {
return [tex]$\text{publisher}$[/tex];
}
[tex]$\text{public void}$[/tex] setPublisher(String [tex]$\text{publisher}$[/tex]) {
this.[tex]$\text{publisher}$[/tex] =[tex]$\text{publisher}$[/tex];
}
public int get[tex]$\text{copiesSold}$[/tex]() {
return [tex]$\text{copiesSold}$[/tex];
}
[tex]$\text{public void}$[/tex] set[tex]$\text{copiesSold}$[/tex](int [tex]$\text{copiesSold}$[/tex]) {
this.[tex]$\text{copiesSold}$[/tex] = [tex]$\text{copiesSold}$[/tex];
}