-- This program prints my name and address at the terminal
-- Author: John Weber
with Ada.Text_Io, Ada.Integer_Text_Io, Ada.Float_Text_Io;
use Ada.Text_Io, Ada.Integer_Text_Io, Ada.Float_Text_Io;
-- Ada 95: From The Beginning
-- Chapter 2, Problem 7
procedure Ch2Problem7 is
   Current : Float := 0.0;
   Previous: Float := 0.0;
   Mileage : Float := 0.0;
   Petrol  : Float := 0.0;
   Registration : String(1..7);
begin
   Put("Please enter auto registration number (7 characters): ");
   Get(Registration);
   Put("Please enter current mileometer reading: ");
   Get(Current);
   Put("Please enter last year's mileometer reading: ");
   Get(Previous);
   Put("Please enter total number of petrol used this year: ");
   Get(Petrol);

   Mileage := Current - Previous;

   Put("Registration number: ");
   Put(Registration);
   New_Line;

   Put("Total mileage: ");
   Put(Mileage);
   New_Line;

   Put("Total petrol consumption in litres: ");
   Put(Petrol);
   New_Line;

   Put("Consumption in litres per mile: ");
   Put(Petrol/Mileage);
   New_Line;

end Ch2Problem7;
