Anda di halaman 1dari 23

HINDUSTAN COMPUTER LIMITED


NITIN KUMAR SINGH

ECE07033
COMPANY PROFILE
 HCL Technologies (A 5 BILLION COMPANY)
 offers world class technology solutions for
the emerging network centric world.
 It provides a range of technology and
software engineering services including
Technology Development Services,
Software Engineering Services ,
Application Engineering Services,
Networking Services .
 These services are predicated on a rich
technology heritage.
HCL Technologies operates through 29 offi
in
14 countries in United States , Europe , Ja
Asia Pacific .
The company employs 3300 IT professionals
worldwide .
HCL Technologies holds 100 % stake in
Intelicent
( former HCL James Martin Inc .),
a US based methodology consulting led
Services Company .
INTODUCTION
 ‘C++’ programming language was
developed at AT&T Bell Laboratories in
the early 1980s by “Bjarne
Stroustrup”.
 As ‘C’ lacking for simulations ,so he
decided to extend the language by
adding features of language, ‘Simula
67’.
 Bjarne Stroustrup called it “C with
classes”.Thename C++ was coined by
Rick Mascitti where “++” is the C
increment operator.It evolved to cope
File Splliter Programme
Program Coding
#include<iostream .h>

#include<conio.h>

#include<stdio.h>

#include<process.h>

#include<io.h>

#include<fcntl.h>

 struct s

{

unsigned char c;


char name [ 40 ], filename [ 40 ], ans ;
long double
size = 0 , i = 0 , j , parts , loop , mod = 0 , mod1 = 0 , option , count
er = 0 ;
unsigned int handel , st = 0 ;
long int status = 0 , whrex , whrey ;
FILE * fp ,* fp1 ;
cout <<" \n\n\t\tWelcome to the File Spliter
Programme ";
cout <<" \n\t\t 1 . Split a File \n\t\t 2 . Join a File
\n\n\t\t Enter The Option :- ";
cin >> option ;
if ( option == 1 )
{
cout <<" \n\n\t Enter The Path of The File which
To Be Splited :- ";
gets ( name );
fp = fopen ( name ," rb ");
if ( fp == NULL )
{
cout <<" \n Cannot Open The Source File ------> Press
Any Key To Exit .......";
getch ();
exit ( 1 );
}
cout <<" \n Please wait ---------------> While File Being
Analysed .........";
while ( fread (& data , sizeof ( data ), 1 , fp )> 0 )
{
size ++;
}
handel = open ( name , O_CREAT );
cout <<" \n\n\t The Size of The File is
"<< filelength ( handel )<<" BYTES ";
mod = size - 1 ;
rewind ( fp );
status = size / 100 ;
cout <<" \n\n\t Enter The Parts In Number To Which
File Is To Be Splited : ";
{
cout <<" \n\n\t Enter The "<< i <<" Target File Name :
";
gets ( filename );
fp1 = fopen ( filename ," wb ");
if ( fp1 == NULL )
{
cout <<" Cannot Open The Target File Name ------
> Press Any Key To Exit .......";
getch ();
exit ( 1 );
}
cout <<" \n\n\t Please Wait ............................ ";
whrex = wherex ();
whrey = wherey ();
for ( j = 1 ; j <= loop ; j ++)
{
fread (& data , sizeof ( data ), 1 , fp );
mod1 ++;
counter ++;
if ( counter == status )
{
st ++;
gotoxy ( 50 , 20 );
cout <<" Completion Status .... "<< st <<" %";
counter = 0 ;
}
if( m o d 1 ! = m o d )
{
fw rite ( & d a ta , size o f( d a ta ) , 1 , fp 1 ) ;
}
}
gotoxy ( whrex , whrey + 1 );
fclose ( fp1 );
}
fclose ( fp );
cout <<" \n\n\t File Spliting Completed \n\n Press
Any Key To Exit .......";
getch ();
}
if ( option == 2 )
{
cout <<" \n\n\t\t Enter The Name of The Target
File : ";
gets ( name );
fp = fopen ( name ," wb ");
if ( fp == NULL )
{
co u t< < " \n \n C a n n o t O p e n T h e Ta rg e t F ile
N a m e ------> P re ss A n y K e y To E x it. . . . . . . " ;
g e tch ( ) ;
e x it( 1 ) ; }
do
{
i ++;
cout <<" \n\t\t Enter The Name of The "<< i << "
File : ";
gets ( filename );
fp1 = fopen ( filename ," rb ");
if ( fp1 == NULL )
{
cout <<" \n\n Cannot Open The Source File Name ------
> Press Any Key To Exit .......";
getch ();
exit ( 1 );
}
cout <<" \n\n\t Please Wait ............................ ";
while ( fread (& data , sizeof ( data ), 1 , fp1 )> 0 )
{
fwrite (& data , sizeof ( data ), 1 , fp );
}
fclose ( fp1 );
cout <<" \n\t\t Do You Want To Join Another File
( y / n ) : ";
cin >> ans ;
}
while ( ans == 'y' );
fclose ( fp );
handel = open ( name , O_CREAT );
cout <<" \n\t\t The Size of The File Is
"<< filelength ( handel )<<" BYTES ";
cout <<" \n\t\t Joining of Files Completed \n\t
Press Any Key To Exit ..........";
getch ();
exit ( 1 );
}
return 0 ;
}
Program output
 Welcome to the File Spliter Programme
 1. Split a File
 2. Join a File

 Enter The Option:-



 Enter The Option:- 1 
 Enter The Path of The File which To Be
Splited:-
 Cannot Open The Source File------>Press
Any Key To Exit....... 

 Welcome to the File Spliter Programme


 1.Split a File
 2.Join a File
 
 Enter The Option:- 1
  
  Enter The Path of The File which To Be

Splited:- cpp
 Please wait--------------->While File Being

Analysed.........
 

 The Size of The File is 2843 BYTES


 Enter The Parts In Number To Which File Is
To Be Splited : 1
 
 Enter The 1 Target File Name : NITIN

Completion Status.... 101 %


 

 Please Wait............................
 File Spliting Completed
  Press Any Key To Exit.......
 Welcome to the File Spliter
Programme
 1. Split a File
 2. Join a File
 Enter The Option:- 2
  
 Enter The Name of The Target File :
 Cannot Open The Target File------>Press Any
Key To Exit.......
  Welcome to the File Spliter Programme
 1. Split a File
 2. Join a File
 Enter The Option:- 2
 Enter The Name of The Target File : cpp
 Enter The Name of The 1 File : NITIN
 
 

 Please Wait............................

 Do You Want To Join Another File (y/n) : y
 

 Enter The Name of The 2 File : wb


  Please Wait............................

 Do You Want To Join Another File (y/n) :


n
 

 The Size of The File Is 2843 BYTES


 Joining of Files Completed
 

 Press Any Key To Exit.......


 


Appendix
 stdio.h Definitions for stream
input/output.
 conio.h Direct MSDOS console
input/output.
 io.h Definitions for low level I/O
functions.
 fcntl.h Define flag values accessible to
open.
 iostream.h basic stream I/O declarations.
 process.h Symbols and structures for
process management.
 char character(a,%,+ etc.)
 int integer(1,2,3,4,5,etc.)
 filename name of a file.
 Parts number of parts for which
prog.is splited/joined.
 Option entering an
option(splitting/joining).
 Counter as a variable.
 Loop size/parts.
 Status size/100.
 Struct structure used.
 Data object of a structure.

Thank you

Anda mungkin juga menyukai