コード例 #1
0
        private static void Livreinit()
        {
            var tax      = new TaxesC3(0.0975, 0.05);
            var sda      = new LivreC3("Le Seigneur des Anneaux Book 1", "J.R.R. Tolkien", 39.20);
            var sda2     = new LivreC3("Le Seigneur des Anneaux Book 2", "J.R.R. Tolkien", 29.99);
            var livListe = new List <LivreC3>()
            {
                sda, sda2
            };

            foreach (var livre in livListe)
            {
                AfficherLivre(livre, tax);
            }
        }
コード例 #2
0
        public static void AfficherLivre(LivreC3 liv, TaxesC3 taxesC3)
        {
            Console.WriteLine("Titre  : " + liv.Titre + "\n" +
                              "Auteur : " + liv.NomAuteur + "\n" +
                              "Prix   : " + liv.Prix.ToString("C2") + "\n\n");


            Console.WriteLine("Titre  : " + liv.Titre + "\n" +
                              "Auteur : " + liv.NomAuteur + "\n" +
                              "Prix   : " + liv.Prix.ToString("C2") + "\n" +
                              "TVQ    : " + (liv.Prix * taxesC3.Tvq).ToString("C2") + "\n" +
                              "TPS    : " + (liv.Prix * taxesC3.Tps).ToString("C2") + "\n" +
                              "PrixTot: " + (liv.Prix + (liv.Prix * taxesC3.Tvq) + (liv.Prix * taxesC3.Tps)).ToString("C2") + "\n\n");

            Console.WriteLine("Enter for next one...");
            Console.ReadLine();
            Console.Clear();
        }