Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TrabajoFinal
- {
- public class Lavarropa : Electrodomestico
- {
- private float cargaEnKilogramos;
- public Lavarropa():base()
- {
- this.cargaEnKilogramos = 10;
- }
- public Lavarropa(float precio, string color, char consumo, float peso, float cargaKG): base(precio, color, consumo, peso)
- {
- }
- private float validarCarga(float valor)
- {
- if (valor<0)
- {
- return 10;
- }
- else
- {
- return valor;
- }
- }
- public float CargaEnKilogramos
- {
- get { return this.cargaEnKilogramos; }
- set { this.cargaEnKilogramos = validarCarga(value); }
- }
- private float precioCarga()
- {
- if (this.cargaEnKilogramos >= 10)
- {
- return this.cargaEnKilogramos / 3;
- }
- else
- {
- return 0;
- }
- }
- public float PrecioFinalLavarropa
- {
- get { return this.PrecioFinal + precioCarga(); }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement