with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; -- Illustrates two things: -- automatic creation of operators for new numeric types -- compiler will not let new types be mixed procedure types3 is type Grade is range 0 .. 100; -- Grade is a new type package Grade_IO is new Ada.Text_IO.Integer_IO(Grade); use Grade_IO; g: Grade := 3; i: Integer := 5; begin g := g * 3; -- Grade * Integer constant is okay g := g * g; -- Grade * grade is okay put(g); new_line; -- g := g * i; -- Compile error: Grade * Integer not defined g := g * Grade(i); i := Integer(g) * i; if g = g then -- Boolean operation = defined on new types put(g); new_line; end if; put(g); new_line; put(i); new_line; end types3;