Estimador de festa - use a cabeça c#

Disponível somente no TrabalhosFeitos
  • Páginas : 2 (373 palavras )
  • Download(s) : 0
  • Publicado : 24 de maio de 2012
Ler documento completo
Amostra do texto
__________________________________________________________________________________

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespaceEstimadorFestaCatarina
{
class DinnerParty : Party
{
private int NumberOfPeople;
public decimal CostOfBeveragesPerPerson;
public decimal CostOfDecorations;
constint CostOfFoodPerPerson = 25;

public DinnerParty(int numberOfPeople, bool healthyOption, bool fancyDecorations)
: base(numberOfPeople, fancyDecorations)
{SetHealthyOption(healthyOption);
CalculateCastOfDecorations(fancyDecorations);
}

public void SetHealthyOption(bool healthyOption)
{
if(healthyOption)
{
CostOfBeveragesPerPerson = 5.00M;
}
else
{
CostOfBeveragesPerPerson = 20.00M;
}}

public decimal CalculateCastOfDecorations(bool fancy) // Calcula o custo da decoração p/ N pessoas
{
if (fancy)
{
CostOfDecorations =(NumberOfPeople * 15.00M) + 50M;
}
else
{
CostOfDecorations = (NumberOfPeople * 7.5M) + 30M;
}
returnCostOfDecorations;
}

// Calcula o custo total acrecscentado decoração bebida comida, desconto se saldável.
public decimal CalculateCost(bool healthyOption)
{decimal totalCost = base.CaltulateCast() + CostOfBeveragesPerPerson * NumberOfPeople;
if (healthyOption)
{
return totalCost * .95M;
}else
{
return totalCost;
}
}

public void setPartyOptions(int people, bool fancy)
{
this.NumberOfPeople = people;...
tracking img