123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Program that checks the space on drive a: and also gives a graphical representation of memory.

--------------------------------------------------------------------------------



{
Description: Checks the space on drive a: and also gives a graphical representation of memory.
}

program floppyspace;
uses crt,dos,graph;
{ This program has been made by Ali ,only by Ali }
var
driver, mode : integer;
theta : real;

procedure test_diskfree;
var
freeb, spaceb : longint;
drive : word;
freekb, spacekb, freemb, spacemb : real;
ch : char;
begin
writeln('Please enter disk in drive A: and press Enter');
readln;
writeln('Checking capacity of DRIVE A: >');
writeln('Please wait...');
delay(1000);
drive := 1 ;
freeb := diskfree(drive);
spaceb := disksize(drive);
freekb := freeb/1024;
spacekb := spaceb/1024;
freemb := freeb/1024000;
spacemb := spaceb/1024000;
theta := (freekb/spacekb)*360;
writeln;
writeln('MEMORY OF DRIVE A :');
writeln(' ':20,spaceb,' B or ');
writeln(' ':20,spacekb:2:2,' KB or ' );
writeln(' ':20,spacemb:2:2,' MB ');
writeln;
writeln('FREE SPACE ON DRIVE A :');
writeln(' ':20,freeb,' B or ');
writeln(' ':20,freekb:2:2,' KB or ');
writeln(' ':20,freemb:2:2,' MB ');
writeln;
writeln('SPACE USED ON DRIVE A :');
writeln(' ':20,spaceb-freeb,' B or ');
writeln(' ':20,spacekb-freekb:2:2,' KB or ');
writeln(' ':20,spacemb-freemb:2:2,' MB ');
if freeb=-1 then
begin
writeln;
writeln('Error reading disk drive!!');
writeln('make sure that the disk is properly inserted');
end
else
begin
writeln;
write('Want the graphical graphical representation ? (Y/N) >');
readln(ch);
if (ch='y') or (ch='Y') then
begin
writeln;
writeln('Press any key to show graphical representation...');
readkey;
initgraph(driver,mode,'d: p gi');
rectangle(100,170,110,160);
setfillstyle(closedotfill,4);
bar(100,200,110,190);
outtextxy(180,400,'Pie chart of available memory on floppy');
outtextxy(120,190,'Space Free');
outtextxy(120,160,'Space Occupied');
pieslice(320,240,0,round(theta),90);
circle(320,240,90);
settextstyle(3,0,2);
outtextxy(250,19,'FLOPPY SPACE');
end
else
writeln('O.K! Then Bye...!');
end;
end;

begin
clrscr;
test_diskfree;
readkey;
end.
--------------------------------------------------------------------------------
 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG