public static string MostrarGalletita(Galletita galleta) { StringBuilder sb = new StringBuilder(); sb.AppendLine("Galletita:"); sb.AppendLine(Producto.MostrarProducto(galleta)); sb.AppendLine("Peso: " + galleta._peso.ToString()); return(sb.ToString()); }
public string MostrarEstante(Estante est) { StringBuilder sb = new StringBuilder(); sb.AppendLine("CONTENIDO DEL ESTANTE"); sb.AppendLine("**********************************************"); foreach (Producto p in est.Productos) { if (p is Jugo) { sb.AppendLine(((Jugo)p).MostrarJugo()); } if (p is Galletita) { sb.AppendLine(Galletita.MostrarGalletita((Galletita)p)); } if (p is Gaseosa) { sb.AppendLine(((Gaseosa)p).MostrarGaseosa()); } } return(sb.ToString()); }