fork download
  1. with Ada.Text_IO, Ada.Integer_Text_IO;
  2. use Ada.Text_IO, Ada.Integer_Text_IO;
  3. procedure Calculator is
  4.  
  5. First, Second : float;
  6. Operator : Character;
  7. begin
  8.  
  9. Put ("Enter an expression in the form [NUMBER1(newline)OPERATOR(newline)NUMBER2] ");
  10. Get (First);
  11. Get (Operator);
  12. Get (Second);
  13.  
  14. case Operator is
  15. when '+' =>
  16. Put (First + Second, Width => 1);
  17. when '-' =>
  18. Put (First - Second, Width => 1);
  19. when '*' =>
  20. Put (First * Second, Width => 1);
  21. when '/' =>
  22. Put (First / Second, Width => 1);
  23. when others => Put ("Invalid operator '");
  24.  
  25. end case;
  26. New_Line;
  27. end Calculator;
  28.  
  29.  
Compilation error #stdin compilation error #stdout 0s 5100KB
stdin
24.5
+
6
compilation info
gcc-4.6 -c -pipe -O2 prog.adb
prog.adb:3:15: warning: file name does not match unit name, should be "calculator.adb"
prog.adb:10:01: no candidate interpretations match the actuals:
prog.adb:10:01: missing argument for parameter "Item" in call to "Get" declared at a-tiinio.ads:70, instance at a-inteio.ads:18
prog.adb:10:01: missing argument for parameter "Item" in call to "Get" declared at a-tiinio.ads:50, instance at a-inteio.ads:18
prog.adb:10:01: missing argument for parameter "Item" in call to "Get" declared at a-textio.ads:240
prog.adb:10:01: missing argument for parameter "Item" in call to "Get" declared at a-textio.ads:206
prog.adb:10:06: expected type "Standard.Integer"
prog.adb:10:06: found type "Standard.Float"
prog.adb:10:06:   ==> in call to "Get" at a-tiinio.ads:55, instance at a-inteio.ads:18
prog.adb:10:06:   ==> in call to "Get" at a-textio.ads:241
prog.adb:10:06:   ==> in call to "Get" at a-textio.ads:207
prog.adb:12:01: no candidate interpretations match the actuals:
prog.adb:12:01: missing argument for parameter "Item" in call to "Get" declared at a-tiinio.ads:70, instance at a-inteio.ads:18
prog.adb:12:01: missing argument for parameter "Item" in call to "Get" declared at a-tiinio.ads:50, instance at a-inteio.ads:18
prog.adb:12:01: missing argument for parameter "Item" in call to "Get" declared at a-textio.ads:240
prog.adb:12:01: missing argument for parameter "Item" in call to "Get" declared at a-textio.ads:206
prog.adb:12:06: expected type "Standard.Integer"
prog.adb:12:06: found type "Standard.Float"
prog.adb:12:06:   ==> in call to "Get" at a-tiinio.ads:55, instance at a-inteio.ads:18
prog.adb:12:06:   ==> in call to "Get" at a-textio.ads:241
prog.adb:12:06:   ==> in call to "Get" at a-textio.ads:207
prog.adb:16:17: no candidate interpretations match the actuals:
prog.adb:16:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:75, instance at a-inteio.ads:18
prog.adb:16:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:59, instance at a-inteio.ads:18
prog.adb:16:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:242
prog.adb:16:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:208
prog.adb:16:28: expected type "Standard.Integer"
prog.adb:16:28: found type "Standard.Float"
prog.adb:16:28:   ==> in call to "Put" at a-tiinio.ads:65, instance at a-inteio.ads:18
prog.adb:16:38: unmatched actual "Width" in call
prog.adb:18:17: no candidate interpretations match the actuals:
prog.adb:18:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:75, instance at a-inteio.ads:18
prog.adb:18:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:59, instance at a-inteio.ads:18
prog.adb:18:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:242
prog.adb:18:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:208
prog.adb:18:28: expected type "Standard.Integer"
prog.adb:18:28: found type "Standard.Float"
prog.adb:18:28:   ==> in call to "Put" at a-tiinio.ads:65, instance at a-inteio.ads:18
prog.adb:18:38: unmatched actual "Width" in call
prog.adb:20:17: no candidate interpretations match the actuals:
prog.adb:20:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:75, instance at a-inteio.ads:18
prog.adb:20:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:59, instance at a-inteio.ads:18
prog.adb:20:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:242
prog.adb:20:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:208
prog.adb:20:28: expected type "Standard.Integer"
prog.adb:20:28: found type "Standard.Float"
prog.adb:20:28:   ==> in call to "Put" at a-tiinio.ads:65, instance at a-inteio.ads:18
prog.adb:20:38: unmatched actual "Width" in call
prog.adb:22:17: no candidate interpretations match the actuals:
prog.adb:22:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:75, instance at a-inteio.ads:18
prog.adb:22:17: missing argument for parameter "Item" in call to "Put" declared at a-tiinio.ads:59, instance at a-inteio.ads:18
prog.adb:22:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:242
prog.adb:22:17: missing argument for parameter "Item" in call to "Put" declared at a-textio.ads:208
prog.adb:22:28: expected type "Standard.Integer"
prog.adb:22:28: found type "Standard.Float"
prog.adb:22:28:   ==> in call to "Put" at a-tiinio.ads:65, instance at a-inteio.ads:18
prog.adb:22:38: unmatched actual "Width" in call
gnatmake: "prog.adb" compilation error
stdout
Standard output is empty