Advertisement
daniv1

Untitled

Mar 28th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. program Rabuk;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. {$R *.res}
  6.  
  7. uses
  8. System.SysUtils;
  9.  
  10. Type Bus = class (TObject)
  11. private
  12. name , number , route , carbrand ,year , AutoMileage :string;
  13. public
  14. Constructor Create();
  15. Procedure SetDriver(s : string);
  16. procedure setNumber(s :string);
  17. procedure setRoute(s :string);
  18. procedure setCarBrand(s :string);
  19. procedure setYear(s :string);
  20. procedure setAutoMileage(s :string);
  21. end;
  22.  
  23.  
  24.  
  25.  
  26.  
  27. Constructor Bus.Create;
  28. begin
  29.  
  30. end;
  31. Procedure Bus.setDriver ( s:string ) ;
  32. begin
  33.  
  34. name :=s;
  35. end;
  36.  
  37. Procedure Bus.setNumber ( s:string ) ;
  38. begin
  39.  
  40. number :=s;
  41. end;
  42.  
  43. Procedure Bus.setroute ( s:string ) ;
  44. begin
  45.  
  46. route :=s;
  47. end;
  48. Procedure Bus.setcarBrand ( s:string ) ;
  49. begin
  50.  
  51. carbrand :=s;
  52. end;
  53. Procedure Bus.setyear ( s:string ) ;
  54. begin
  55.  
  56. year :=s;
  57. end;
  58. Procedure Bus.setAutoMileage ( s:string ) ;
  59. begin
  60.  
  61. automileage :=s;
  62. end;
  63.  
  64.  
  65.  
  66.  
  67.  
  68. Var
  69. busArr : Array[1..5] of Bus;
  70. s:String;
  71. i : Integer;
  72. begin
  73. s:='dick';
  74. for i:=1 to 6 do begin
  75. busArr[i].setdriver('dick');
  76. end;
  77. writeln(busarr[1].name);
  78. Readln;
  79. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement