Advertisement
Hodge-1053

Disk Bad Sectors Pascal Program

Jul 26th, 2016
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.70 KB | None | 0 0
  1. program sectors;
  2.  
  3. uses crt;
  4.  
  5. const    bytes_per_sector       =       512;
  6.  
  7. var      bs,final       :       Integer;
  8.          disk           :       string;
  9.          yo             :       Char;
  10.  
  11. begin
  12.      repeat {*** enter the details ***}
  13.      clrscr;
  14.      write('Enter your disk details: ');
  15.      readln(disk);
  16.      writeln;
  17.      write('Enter the number of bytes in bad sectors: ');
  18.      readln(bs);
  19.      writeln;
  20.  
  21. { *** Here's where we work out how many bad clusters are on the disk ***}
  22.      final:=bs div bytes_per_sector;
  23.  
  24.      writeln('Your ',disk,' disk has ',final,' bad clusters on it.');
  25.  
  26.      gotoxy(1,24);
  27.      write('Again? ');
  28.      readln(yo);
  29.      until yo in ['n','N'];
  30. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement