計算機科学のブログ

objects…get oriented! Making code make sense - Use intuitive class and method names

Head First C#: A Learner’s Guide to Real-World Programming with C# and .NET Core (Andrew Stellman(著)、Jennifer Greene(著)、O’Reilly Media)のChapter 3(objects…get oriented! Making code make sense)、p.143(Sharpen your pencil)の解答を求めてみる。

コード

using System;

namespace MyFirstConsoleApp
{
    // class Class23
    class CandyMaker
    {
        static void CandyBarWeight() { }
        static void PrintWrapper() { }
        static void GenerateReport() { }
        static void Go() { }
    }
    // class DeliveryGuy { }
    // class DeliveryGirl { }
    class DeliveryPerson
    {
        static void AddPizza() { }
        static void PizzaDelivered() { }
        static void TotalCash() { }
        static void ReturnTime() { }
    }
    class CashRegister
    {
        static void MakeSale() { }
        static void NoSale() { }
        // static void PumpGas() { }
        static void Refund() { }
        static void TotalCashInRegister() { }
        static void GetTransactionList() { }
        static void AddCash() { }
        static void RemoveCash() { }
    }
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}