close

參考答案

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);
        }

        
    }
}
 

執行結果

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Dino 的頭像
    Dino

    Dino`s Note

    Dino 發表在 痞客邦 留言(0) 人氣()