コード例 #1
0
        static void Main(string[] args)
        {
            Loan aLoan = new Loan();

            aLoan.LoanNumber = 2239;
            aLoan.LastName   = "Mitchel";
            aLoan.LoanAmount = 1000.00;
            Console.WriteLine($"Loan #{aLoan.LoanNumber} for {aLoan.LastName} is for {aLoan.LoanAmount.ToString("C2")}");

            CarLoan aCarLoan = new CarLoan();

            aCarLoan.LoanNumber = 3358;
            aCarLoan.LastName   = "Jansen";
            aCarLoan.LoanAmount = 20000.00;
            aCarLoan.Make       = "Ford";
            aCarLoan.Year       = 2005;
            Console.WriteLine($"Loan #{aCarLoan.LoanNumber} for " +
                              $"{aCarLoan.LastName} is for " +
                              $"{aCarLoan.LoanAmount.ToString("C2")}");
            Console.WriteLine($"Loan #{aCarLoan.LoanNumber} for " +
                              $"{aCarLoan.LastName} is for a " +
                              $"{aCarLoan.Year} {aCarLoan.Make}");

            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Loan aLoan = new Loan();

            aLoan.LoanNumber = 2239;
            aLoan.LastName   = "Mitchell";
            aLoan.LoanAmount = 1000.00;
            Console.WriteLine("Loan #{0} for {1} is for {2:C2}", aLoan.LoanNumber, aLoan.LastName, aLoan.LoanAmount);
            CarLoan aCarLoan = new CarLoan();

            aCarLoan.LoanNumber = 3358;
            aCarLoan.LastName   = "Jansen";
            aCarLoan.LoanAmount = 20000.00;
            aCarLoan.Make       = "Ford";
            aCarLoan.Year       = 2005;
            Console.WriteLine("Loan #{0} for {1} is for {2:C2}", aCarLoan.LoanNumber, aCarLoan.LastName, aCarLoan.LoanAmount);
            Console.WriteLine("\tLoan #{0} is for a {1} {2}", aCarLoan.LoanNumber, aCarLoan.Year, aCarLoan.Make);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            Loan aLoan = new Loan();

            aLoan.LoanNumber = 2239;
            aLoan.LastName   = "Mitchell";
            aLoan.LoanAmount = 1000.00;
            WriteLine("Loan #{0} for {1} is for {2}", aLoan.LoanNumber, aLoan.LastName, aLoan.LoanAmount.ToString("C2"));

            CarLoan carLoan = new CarLoan();

            carLoan.LoanNumber = 3358;
            carLoan.LastName   = "Jansen";
            carLoan.LoanAmount = 20000.00;
            carLoan.Make       = "Ford";
            carLoan.Year       = 2005;
            WriteLine("Car Loan #{0} for {1} is for {2} for a car from: {3}, year: {4}", carLoan.LoanNumber, carLoan.LastName, carLoan.LoanAmount.ToString("C2"), carLoan.Make, carLoan.Year);
        }