with Text_IO; use Text_IO; with Generic_Elementary_Functions; procedure Main_Driver is type Float_Num is digits 15; package Elem_Funcs is new Generic_Elementary_Functions (Float_Num); package Float_Num_IO is new Float_IO (Float_Num); use Elem_Funcs, Float_Num_IO; X, Y, Z, Base, Cycle, S, C, T, Ct, Sh, Ch, Th, Cth : Float_Num; Pi : constant := 3.14159_26535_89193; Pi_by_2 : constant := Pi*0.5; Zero : constant := 0.0; begin New_Line(2); Put(" Trying the Cycle case of Tan/Cot "); New_Line(2); for Count in Integer'(1)..3 loop Put(" Input Cycle <- "); Get(Cycle); Put(" Input X <- "); Get(X); T := Tan( X, Cycle ); Put(" Tan(X, Cycle) = "); Put(T); New_Line; T := Tan(X); Put(" Tan(X) = "); Put(T); New_Line; end loop; New_Line(2); Put(" Trying the Cycle case of Tan/Cot "); New_Line(2); for Count in Integer'(1)..3 loop Put(" Input Cycle <- "); Get(Cycle); Put(" Input X <- "); Get(X); T := Cot(X); Put(" Cot(X) = "); Put(T); New_Line; T := Cot( X, Cycle ); Put(" Cot(X, Cycle) = "); Put(T); New_Line; end loop; New_Line(2); Put(" Trying Sin, Cycle and natural "); New_Line(2); for Count in Integer'(1)..3 loop Put(" Input Cycle <- "); Get(Cycle); Put(" Input X <- "); Get(X); S := Sin(X,Cycle); Put(" Sin(X,Cycle) = "); Put(S); New_Line; Put(" Input X <- "); Get(X); S := Sin( X ); Put(" Sin(X) = "); Put(S); New_Line; end loop; New_Line(2); Put(" Trying Cos, Cycle and natural "); New_Line(2); for Count in Integer'(1)..3 loop Put(" Input Cycle <- "); Get(Cycle); Put(" Input X <- "); Get(X); C := Cos(X,Cycle); Put(" Cos(X,Cycle) = "); Put(C); New_Line; Put(" Input X <- "); Get(X); C := Cos( X ); Put(" Cos(X) = "); Put(C); New_Line; end loop; New_Line(2); Put(" Trying the Exponential Family"); New_Line(2); Put(" Input X and a Base; X <- "); Get(X); Put(" Base <- "); Get(Base); Y := Exp(X); Z := Base**X; Put(" X = "); Put(X); New_Line; Put(" Exp(X) = "); Put(Y); New_Line; Put(" Log(Exp(X)) = "); Put(Log(Y)); New_Line; Put(" Base**X = "); Put(Z); New_Line; Put(" Log(Base**X, Base) = "); Put(Log(Z,Base)); New_Line; New_Line(5); Put(" Trying the Trigonometric Family"); New_Line(2); Put(" Input X and a Cycle; X <- "); Get(X); Put(" Cycle <- "); Get(Cycle); S := Sin(X); C := Cos(X); T := Tan(X); Ct := Cot(X); Put(" X = "); Put(X); New_Line; Put(" Sin(X) = "); Put(S); New_Line; Put(" ArcSin(Sin(X)) = "); Put(ArcSin(S)); New_Line; Put(" Cos(X) = "); Put(C); New_Line; Put(" ArcCos(Cos(X)) = "); Put(ArcCos(C)); New_Line; Put(" Tan(X) = "); Put(T); New_Line; Put(" ArcTan(S,C) = "); Put(ArcTan(S,C)); New_Line; Put(" Cot(X) = "); Put(Ct); New_Line; Put(" ArcCot(C,S) = "); Put(ArcCot(C,S)); New_Line; New_Line(5); Put(" Trying the Hyperbolic Family"); New_Line(2); Put(" Input X ; X <- "); Get(X); Sh := Sinh(X); Ch := Cosh(X); Th := Tanh(X); Cth := Coth(X); Put(" X = "); Put(X); New_Line; Put(" Sinh(X) = "); Put(Sh); New_Line; Put(" ArcSinh(Sinh(X)) = "); Put(ArcSinh(Sh)); New_Line; Put(" Cosh(X) = "); Put(Ch); New_Line; Put(" ArcCosh(Cosh(X)) = "); Put(ArcCosh(Ch)); New_Line; Put(" Tanh(X) = "); Put(Th); New_Line; Put(" ArcTanh(Tanh(X)) = "); Put(ArcTanh(Th)); New_Line; Put(" Coth(X) = "); Put(Cth); New_Line; Put(" ArcCoth(Coth(X)) = "); Put(ArcCoth(Cth)); New_Line; exception when data_error => put ("ERROR! The number entered does not conform to a floating point"); Put( " digits.digits "); end Main_Driver;