with Ada.Float_Text_IO; with Ada.Text_IO; procedure Paint_Coverage is Pi : constant Float := 3.1415926; Length : Float range 1.0 .. 100.0; -- of wall in feet Height : Float range 1.0 .. 20.0; -- of wall in feet Diameter : Float range 0.0 .. 120.0; -- of window in inches Coverage : Float range 50.0 .. 700.0; -- Square feet per gallon of paint Area_Of_Wall : Float range 1.0 .. 20000.0; -- Square feet Area_Of_Window : Float range 0.0 .. 80.0; -- Square feet Area_To_Paint : Float range 1.0 .. 20000.0; -- Square feet Radius : Float range 0.0 .. 5.0; -- of window in feet Amount_Of_Paint : Float range 0.0 .. 40.0; -- Gallons begin -- Get Data Ada.Text_IO.Put (Item => "How many feet long is the wall? "); Ada.Float_Text_IO.Get (Item => Length); Ada.Text_IO.Put (Item => "How many feet high is the wall? "); Ada.Float_Text_IO.Get (Item => Height); Ada.Text_IO.Put (Item => "How many inches is window diameter? "); Ada.Float_Text_IO.Get (Item => Diameter); Ada.Text_IO.Put (Item => "How many square feet does 1 gallon of paint cover? "); Ada.Float_Text_IO.Get (Item => Coverage); -- Calculate the area to be painted Area_Of_Wall := Length * Height; -- Calculate area of window Radius := Diameter / 24.0; Area_Of_Window := Pi * Radius **2; Area_To_Paint := Area_Of_Wall - Area_Of_Window; Amount_Of_Paint := 2.0 * Area_To_Paint / Coverage; Ada.Text_IO.Put (Item => "You will need "); Ada.Float_Text_IO.Put (Item => Amount_Of_Paint, Fore => 1, Aft => 1, Exp => 0); Ada.Text_IO.Put (Item => " gallons of paint."); end Paint_Coverage;