參考答案
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSD03
{
public enum CustomerType
{
Standard,
SmallAndMediumBusiness,
Enterprise,
Government
}
class Program
{
static void Main(string[] args)
{
int amount = 150000;
PriceCalculator p = new PriceCalculator(amount);
p.CalculatePrice();
Console.ReadLine();
}
}
// TODO: write PriceCalculator class to implement required function.
public class PriceCalculator
{
CustomerType customerType;
int amount=0;
public PriceCalculator(int amount)
{
this.amount = amount;
}
public void CalculatePrice()
{
Console.WriteLine("=== Each Price Level at ${0:N0} ===",amount);
Console.WriteLine("{0} Price: ${1:N0}", CustomerType.Standard.ToString(), amount * 1.25);
Console.WriteLine("{0} Price: ${1:N0}", "SMB".ToString(), amount * 1.20);
Console.WriteLine("{0} Price: ${1:N0}", CustomerType.Enterprise.ToString(), amount * 1.15);
Console.WriteLine("{0} Price: ${1:N0}", CustomerType.Government.ToString(), amount * 1.1);
}
}
}
執行結果
留言列表