namespace Pr19; public class LibroDiTesto : Libro { public string Materia { get; private set; } private bool adottato; public string Adottato { get { return adottato ? "si" : "no"; } set { if (value == "si") adottato = true; else adottato = false; } } public string Volume { get; private set; } public LibroDiTesto(string isbn, string titolo, string autore, string materia, string adottato, string volume, double prezzoCopertina) : base(isbn, titolo, autore, prezzoCopertina) { Materia = materia; Adottato = adottato; Volume = volume; } public override double PrezzoVendita() { return PrezzoCopertina - ((PrezzoCopertina * 20) / 100); } public override string ToString() { return String.Format("ISBN: {0}, Titolo: {1}, Autore: {2}, Materia: {3}, Adottato: {4}, Volume: {5}, Prezzo Copertina: {6}, Prezzo Vendita: {7}", Isbn, Titolo, Autore, Materia, Adottato, Volume, PrezzoCopertina, PrezzoVendita()); } }