Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Rabuk;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils;
- Type Bus = class (TObject)
- private
- name , number , route , carbrand ,year , AutoMileage :string;
- public
- Constructor Create();
- Procedure SetDriver(s : string);
- procedure setNumber(s :string);
- procedure setRoute(s :string);
- procedure setCarBrand(s :string);
- procedure setYear(s :string);
- procedure setAutoMileage(s :string);
- end;
- Constructor Bus.Create;
- begin
- end;
- Procedure Bus.setDriver ( s:string ) ;
- begin
- name :=s;
- end;
- Procedure Bus.setNumber ( s:string ) ;
- begin
- number :=s;
- end;
- Procedure Bus.setroute ( s:string ) ;
- begin
- route :=s;
- end;
- Procedure Bus.setcarBrand ( s:string ) ;
- begin
- carbrand :=s;
- end;
- Procedure Bus.setyear ( s:string ) ;
- begin
- year :=s;
- end;
- Procedure Bus.setAutoMileage ( s:string ) ;
- begin
- automileage :=s;
- end;
- Var
- busArr : Array[1..5] of Bus;
- s:String;
- i : Integer;
- begin
- s:='dick';
- for i:=1 to 6 do begin
- busArr[i].setdriver('dick');
- end;
- writeln(busarr[1].name);
- Readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement