using System;
using System.Collections.Generic;
using System.Text;

namespace ModernLangToolsApp
{
    public class ReportPrinter
    {
        private readonly IEnumerable<Person> people;
        private readonly Action headerPrinter;
        private readonly Action footerPrinter;
        private readonly Action<Person> elemPrinter;

        public ReportPrinter(IEnumerable<Person> people, Action headerPrinter, Action footerPrinter, Action<Person> elemPrinter)
        {
            this.people = people;
            this.headerPrinter = headerPrinter;
            this.footerPrinter = footerPrinter;
            this.elemPrinter = elemPrinter;
        }

        public void PrintReport()
        {
            headerPrinter();
            Console.WriteLine("------------------------------------------");
            int i = 0;
            foreach (var person in people)
            {
                elemPrinter(person);
            }
            Console.WriteLine("---------------- Summary ------------------");
            footerPrinter();
        }
    }
}
