Advertisement
Guest User

felix

a guest
Sep 6th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 2.54 KB | None | 0 0
  1. with Ada.Text_IO;
  2. with Ada.Integer_Text_IO;
  3. with ada.float_text_IO;
  4.  
  5. procedure In_Och_utmatningar is
  6.    N : Integer;
  7.    S : String (1..5);
  8.    K : float;
  9.    C : Character ;
  10. begin
  11.    Ada.Text_IO.Put("Skriv in ett heltal: ");
  12.    Ada.Integer_Text_IO.Get(N);
  13.    
  14.   Ada.Text_IO.Put("Du skrev in talet: ");
  15.   Ada.Integer_TEXT_IO.Put(N,Width=>0);
  16.  ada.text_IO.SKIP_LINE;
  17. Ada.Text_IO.New_Line(1);
  18.  
  19.    
  20.     Ada.Text_IO.Put("Skriv in fem heltal: ");
  21. Ada.Integer_Text_IO.Get(N);
  22.        
  23.    
  24.  
  25. Ada.Text_IO.Put("Du skrev in talen: ");
  26.     Ada.Integer_Text_IO.Put(N,Width=>4);
  27.  
  28.      Ada.Integer_Text_IO.Get(N);
  29.      Ada.Integer_Text_IO.Put(N,Width=>4);
  30.      Ada.Integer_Text_IO.Get(N);
  31.      Ada.Integer_Text_IO.Put(N,Width=>4);
  32.      Ada.Integer_Text_IO.Get(N);
  33.      Ada.Integer_Text_IO.Put(N,Width=>4);
  34.      Ada.Integer_Text_IO.Get(N);
  35.     Ada.Integer_Text_IO.Put(N,Width=>4);
  36.  
  37.     ada.text_IO.new_line(1);
  38. ada.text_io.skip_line;
  39. Ada.Text_iO.put("Skriv in ett flyttal: ");
  40. Ada.float_text_io.get(k);
  41. ada.text_Io.put("Du skrev in flyttalet: ");
  42. ada.float_TEXT_IO.put(K, fore=> 2, aft => 3,exp =>0);
  43. ada.text_io.skip_line;
  44. ADA.TEXT_io.New_line(1);
  45. ada.text_io.put("Skriv in ett heltal och ett flyttal: ");
  46. ada.integer_text_IO.get(N);
  47. ada.float_text_IO.get(K);
  48. ada.text_io.put("Du skrev in heltalet: ");
  49. Ada.integer_text_IO.put(N,Width=>4);
  50. ada.text_io.New_line(1);
  51. ada.text_IO.put("Du skrev in flyttalet: ");
  52. Ada.float_text_IO.put(k,Fore=>2,Aft=>4,exp=>0);
  53. Ada.text_Io.Skip_line;
  54. ada.text_IO.new_line(1);
  55. Ada.text_io.put("Skriv in ett tecken : " ) ;
  56. ada.text_io.get(C);
  57. ada.text_io.put("Du skrev in tecknet : " );
  58. ada.text_IO.put (C);
  59. ada.text_io.skip_line;
  60. ada.text_io.new_line(1);
  61. ada.text_io.put("Skriv in en sträng med 5 tecken: ");
  62. ada.text_io.get(S);
  63. ada.text_io.put("Du skrev in strängen: ");
  64. ada.text_IO.put(S);
  65. ada.text_io.skip_line;
  66. Ada.text_io.new_line(1);
  67. ada.text_io.Put("Skriv in en sträng med 3 tecken: ");
  68. Ada.text_io.get(S(1..3));
  69. Ada.text_IO.put("Du skrev in strängen: ");
  70. Ada.text_io.put(S(1..3));
  71. ada.text_io.Skip_line;
  72. Ada.text_io.new_line(1);
  73. Ada.text_io.put("Skriv in ett heltal och en sträng med 5 tecken: ");
  74.  
  75. ada.integer_text_IO.get(N);
  76. Ada.Text_IO.Get(C);
  77. Ada.text_IO.get(S);    
  78.  
  79.  
  80. Ada.text_IO.put("Du skrev talet:");
  81. Ada.text_IO.put("|");
  82. Ada.integer_text_IO.put(N,width=>0);
  83. Ada.text_IO.put("|");
  84. ada.text_IO.put(" och strängen ");
  85. Ada.text_IO.put("|");
  86. ada.text_IO.Put(S);
  87. Ada.text_IO.put("|");
  88. Ada.Text_IO.New_Line(1);
  89. Ada.Text_Io.SKIP_LINE;
  90.  
  91.  
  92.  
  93.    
  94.        
  95. end In_Och_Utmatningar;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement