#include
#include
#include
class myfolder
{
private: char filename[10][25];
long totspace();
long usedspace();
public: void newentry();
void showfiles();
float retspace();
};
void myfolder::newentry()
{
cout<<"Enter flenames:\n";
for(int i=0; i<10;>
gets(filename[i]);
cout<
}
long myfolder::totspace()
{
long t=10*25*1;
return(t);
}
long myfolder::usedspace()
{
long j, space=0;
for(int i=0; i<10;>
{
j=0;
while(filename[i][j]!='\0')
{
space++;j++;
}
space++;
}
return(space);
}
float myfolder::retspace()
{
long tot= totspace();
long used= usedspace();
float kb= float(tot-used)/1024;
cout<<"Total space="<<<" bytes."<
cout<<"Used space="<<<" bytes."<
return(kb);
}
void myfolder::showfiles()
{
for(int i=0; i<10;>
{
cout<<<". ";
puts(filename[i]);
}
}
void main()
{
clrscr();
int n;
float KB=0;
myfolder mf;
mf.newentry();
KB=mf.retspace();
cout<<"Total space available is "<<< "KB."<<
mf.showfiles();
getch();
}
People please add the header files iostream, conio and stdio...
ReplyDeleteIt is showing some errors while posting..
gagneet r u gonna update dis throughout d year?
ReplyDeletewow man.....cool
ReplyDeleteu took my rply seriously...nyway good for me
thanx
@priyanka.... I don't know.. You people should keep motivating me... :D
ReplyDelete@gagneet- get me ur id...i've done d 5th n 6th programs .
ReplyDelete