Design a class called Writer, which is designed to model a book's writer. It contains:

public Writer(String name, String email,char gender) {......}

(There are no setters for name and gender, as these attributes cannot be changed.)

Also, design a class called Book to model a book written by one writer. It contains:

publicBook (String name, Writer[] writer,double price) { ...... }
publicBook (String name, Writer[] writer,double price,int qty) { ...... }

class Writer
{
  private String name;
  private String email;
  private char gender;
  public Writer(String name,String email,char gender)
  {
    this.name=name;
    this.email=email;
    this.gender=gender;
  }
  public String getName()
  {
    return name;
  }
  public String getEmail()
  {
    return email;
  }
  public void setEmail(String email)
  {
    this.email=email;
  }
  public char getGender()
  {
    return gender;
  }
  public String toString()
  {
    return "Writer[name="+name+",email="+email+",gender="+gender+"]";
  }
}

class Book
{
  private String name;
  private Writer[]writers;
  private double price;
  private int qty;
  public Book(String name,Writer[]writers,double price)
  {
    this.name=name;
    this.writers=writers;
    this.price=price;
  }
  public Book(String name,Writer[]writers,double price,int qty)
  {
    this.name=name;
    this.writers=writers;
    this.price=price;
    this.qty=qty;
  }
  public String getName()
  {
    return name;
  }
  public double getPrice()
  {
    return price;
  }
  public void setPrice(double price)
  {
    this.price=price;
  }
  public int getQty()
  {
    return qty;
  }
  public void setQty(int qty)
  {
    this.qty=qty;
  }
  public String toString()
  {
    StringBuilder sb=new StringBuilder();
    sb.append("{");
    for(int i=0;i<writers.length;i++)
    {
      sb.append(writers[i].toString());
      if(i<writers.length-1)
      {
        sb.append(",");
      }
    }
    sb.append("}");
    return "Book[name="+name+",Writers="+sb.toString()+",price="+price+",qty="+qty;
  }
}