|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 2095 (0x82f)
Types: TextFile
Names: »B«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
└─⟦124ff5788⟧ »DATA«
└─⟦this⟧
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
└─⟦6f12a12be⟧ »DATA«
└─⟦this⟧
WITH Text_Io;
WITH Complex_Client;
PROCEDURE Client_Driver IS
PACKAGE Fio IS NEW Text_Io.Float_Io (Float);
X_Real_Part : Float;
X_Imag_Part : Float;
Y_Real_Part : Float;
Y_Imag_Part : Float;
Next_Op : Character;
Result, X, Y : Complex_Client.Number;
BEGIN
Text_Io.Put_Line ("This program demonstrates the RPC facility.");
Text_Io.Put_Line
("The service allows clients to perform complex number arithmatic.");
Text_Io.Put_Line
("You will be prompted to enter two complex numbers: X and Y,");
Text_Io.Put_Line ("and either addition or subtraction as the operation.");
Text_Io.Put_Line ("");
Text_Io.Put_Line ("");
LOOP
Text_Io.Put_Line ("Enter X Real Part ('Q' for Quit)");
Fio.Get (Item => X_Real_Part, Width => 0);
Text_Io.Put_Line ("Enter X Imaginary Part ('Q' for Quit)");
Fio.Get (Item => X_Imag_Part, Width => 0);
X := Complex_Client.Make (X_Real_Part, X_Imag_Part);
Text_Io.Put_Line ("Enter Y Real Part ('Q' for Quit)");
Fio.Get (Item => Y_Real_Part, Width => 0);
Text_Io.Put_Line ("Enter Y Imaginary Part ('Q' for Quit)");
Fio.Get (Item => Y_Imag_Part, Width => 0);
Y := Complex_Client.Make (Y_Real_Part, Y_Imag_Part);
Text_Io.Put_Line ("");
Text_Io.Put_Line
("Enter 'A' for Addition, 'S' for Subtract, or 'Q' for Quit");
Text_Io.Get (Next_Op);
CASE Next_Op IS
WHEN 'A' | 'a' =>
Result := Complex_Client.Plus (X, Y);
Text_Io.Put_Line ("");
Text_Io.Put ("X + Y = ");
WHEN 'S' | 's' =>
Result := Complex_Client.Minus (X, Y);
Text_Io.Put_Line ("");
Text_Io.Put ("X - Y = ");
WHEN OTHERS =>
EXIT;
END CASE;
Fio.Put (Complex_Client.Real_Part (Result));
Text_Io.Put (" + ");
Fio.Put (Complex_Client.Imaginary_Part (Result));
Text_Io.Put_Line ("i");
Text_Io.Put_Line ("");
Text_Io.Put_Line ("");
END LOOP;
EXCEPTION
WHEN OTHERS =>
NULL;
END Client_Driver;
PRAGMA Main;