Académique Documents
Professionnel Documents
Culture Documents
R. V. COLLEGE OF ENGINEERING,
BANGALORE-560059
(Autonomous Institution Affiliated to VTU, Belgaum)
Submitted by
Submitted to
Naga Madhuri KG
CERTIFICATE
Certified that the Self Study work titled File Representation using C++ is carried out by Darshan.K.N,
Gowtham.J, Mohan.S, Vinay.Kumar.H.S and Yatish.Kumar.S, who are bonafide student of R.V College
of Engineering, Bangalore, in partial fulfillment for the award of degree of Bachelor of Engineering in
Electronics And Communication of the Visvesvaraya Technological University, Belgaum during the year
2016. It is certified that all corrections/suggestions indicated for the internal Assessment have been
incorporated in the report deposited in the departmental library. The Self Study report has been
approved as it satisfies the academic requirements in respect of Self Study work prescribed by the
institution for the said degree.
CONTENTS
1. Introduction....3
2. Methodology ....3
3. Flowchart and code.................3
4. Result...................5
5. References...6
Introduction
Flowchart and Code
The DQS system present in the electric car
has the record of data such as voltages,
currents, temperatures, etc at different
subsystems recorded at regular intervals of
time. This data is stored in a nonvolatile
memory, in the form of hex numbers. When
this data is copied into text file in a computer,
the hex numbers are stored in ASCII format
as shown in fig 2. It is possible to interpret
this data manually for small set of values but
when the number of values increases, it turns
out to be impractical to do it manually,
leading to the need of a software support for
interpretation. The current software developed
for this purpose converts the Hex represented
using ASCII values into Decimal, and
classifies it, forming a readable output.
Methodology
time(int a=0,int b=0, int c=0) write_file_name= new char [500]; // name
{ in array will be not be deleted completely and
h=a;m=b;s=c; remaining char will join the newly given
} name at end
setime(int a,int b, int c) // dynamic is deleted at end;
{
h=a;m=b;s=c; cout<< "enter read file name with extension
} or entire address path with name and
void operator ++() extension(use '\\\\' insted of '\\') (space in
{ between is not allowed)"<<endl; // '\\' will
s=s+10; print '\'
if(s>59) cin>>read_file_name;
{ cout<< "enter write file name with extension
s=s-60; or entire address path with name and
m++; extension(use '\\\\' insted of '\\') (space in
if(m>59) between is not allowed)"<<endl; // '\\' will
{ print '\'
m-=60; cin>>write_file_name;
h++;
if(h>24)
{
h=0; ifstream read(read_file_name); // opening
} the read file with mode input; with name
} inside read_file_name;
}
} if ( read.is_open() )
friend ostream& operator<<(ostream& out, {
time& T) ofstream write (write_file_name); // opening
{ write file with name inside write_file_name;
out <<T.h<<": "<<T.m<<": "<<T.s; with mode output; previous file is opened if
return out; present else newly created
}
}; if (write.is_open())
{
int main () {
char *read_file_name,*write_file_name,ch[3];
unsigned int retry ,decimal,a[3],i,j=0,k,F=0; time T(10,10,10);
string buffer; // buffer.size();
start: will get size of buffer; now buffer is object of
class string; whose size varies according to
the data stored in it;
read_file_name= new char [500]; // if write<<"\t\t\t\t\t\t Project \t File
static array is used when retrying the code, Management\t\t\t\t\t\n";
when new name is smaller than previous
name, previous while(getline (read,buffer))
{
Reference