PROGRAM WeekProfits(input,output);

TYPE
   DaysOfWeek = (Mon,Tues,Weds,Thurs,Fri,Sat,Sun);
   WeekArray = ARRAY[DaysOfWeek] OF Real;

VAR
  Revenues,
  Costs,
  Profits : WeekArray;
  Day : DaysOfWeek;
  TotalProfits : Real;


FUNCTION PrintDay (Day : DaysOfWeek) : String;
Begin
   CASE Day OF
     Mon : PrintDay := 'Monday';
     Tues : PrintDay := 'Tuesday';
     Weds : PrintDay := 'Wednesday';
     Thurs : PrintDay := 'Thursday';
     Fri : PrintDay := 'Friday';
     Sat : PrintDay := 'Saturday';
     Sun : PrintDay := 'Sunday';
   End;
End;



BEGIN
   TotalProfits := 0;

   FOR Day := Mon TO Sun DO
     Begin
       Write('Enter ',PrintDay(Day),' revenues and costs ');
       Readln(Revenues[Day],Costs[Day]);
       Profits[Day] := Revenues[Day] - Costs[Day];
       TotalProfits := TotalProfits + Profits[Day];
     End;

   Writeln('Total profits: $',TotalProfits:8:2);
END.
