Beispiel #1
0
        private double GetTotalCharge()
        {
            double result  = 0;
            var    rentals = _rentals.GetEnumerator();

            while (rentals.MoveNext())
            {
                Rental each = rentals.Current;
                result += each.GetCharge();
            }
            return(result);
        }
Beispiel #2
0
        public String HtmlStatement()
        {
            var    rentals = _rentals.GetEnumerator();
            string result  = $"<H1>Rental for <EM>{Name}</EM></H1><P>\n";

            while (rentals.MoveNext())
            {
                Rental each = rentals.Current;
                result += $"{each.Movie.Title}: {each.GetCharge()}<BR>\n";
            }

            result += $"<P>You owe <EM>{GetTotalCharge()}</EM><P>\n";
            result += $"On this rental you earned <EM>{GetTotalFrequentRenterPoints()}</EM> frequent reter points<P>";
            return(result);
        }
Beispiel #3
0
        public string Statement()
        {
            var    rentals = _rentals.GetEnumerator();
            string result  = $"Rental Record for {Name}\n";

            while (rentals.MoveNext())
            {
                Rental each = rentals.Current;
                result += $"\t{each.Movie.Title}\t{each.GetCharge()}\n";
            }

            result += $"Amount owed is {GetTotalCharge()}\n";
            result += $"You earned {GetTotalFrequentRenterPoints()  } frequent reter points";
            return(result);
        }