Thursday, 30 June 2011

Re: (VU-Study-Corner) Important about CS201 Assignment#4 Solution


#include<iostream.h>
#include<fstream.h>

main()
{

ifstream inFile;

ofstream outFile;

char outputFileName[]="Electricity_Bill.txt";
char outputText[]="\t\t\tElectricity Consumer Bill\n"
"---------------------------------------------------------------------------\n"
"Reference No Tariff Load Old A/C No\n"
"123456789123456 2 1 123456789123456\n"
"\n---------------------------------------------------------------------------\n"
"Name and Address \n"
"XYZ Lahore Pakistan \n"
"\n---------------------------------------------------------------------------\n"
"Reading MF Total Unit Consumed Total Cost of electricity\n"
"55671 1 328 9999\n"
"\n---------------------------------------------------------------------------\n"
"Month Units Bill Current Bill 10732\n"
"Jan-11 312 5000 Arrears 0\n"
"Feb-11 312 5000 Tariff Subsidy NA\n"
"Mar-11 312 5000 Payable within Duedate 10732 \n"
"\n---------------------------------------------------------------------------\n";

outFile.open(outputFileName, ios::out);

if(!outFile)
{
cout << "Can't open file named " << outputFileName << endl;
exit(1);
}

outFile << outputText;

outFile.close();

char inputFileName[]="Electricity_Bill.txt";
const int MAX_CHAR_TO_READ = 100;
char completeLineText[MAX_CHAR_TO_READ];

inFile.open(inputFileName);
if(!inFile)
{
cout <<"Can't open input file named " << inputFileName << endl;
exit(1);
}

while(!inFile.eof())
{
inFile.getline(completeLineText,MAX_CHAR_TO_READ);
cout << completeLineText << endl;
}

inFile.close();
system("pause");
}
find the attach file and inform me

On Thu, Jun 30, 2011 at 5:43 PM, mc110200084 Adeel Hassan <mc110200084@vu.edu.pk> wrote:
yeh wong hy handout page 207 per yeh program hy

On 6/30/11, ~kanch ki gurya~ <mc110200341@vu.edu.pk> wrote:
> any one know programming i need help
>
> On Thu, Jun 30, 2011 at 2:57 PM, mc110201797 Saima Nazeer <
> mc110201797@vu.edu.pk> wrote:
>
>>
>>
>> AOA
>> bt yahan error aa raha hai?
>>
>>
>>
>> --
>> Join us at facebook: https://www.facebook.com/VU.Study.Corner
>>
>> Group Link: http://groups.google.com/group/VU-Study-Corner?hl=en
>>
>> Group Rules:
>> http://groups.google.com/group/VU-Study-Corner/web/group-rules
>>
>> Unsubscribe: VU-Study-Corner+unsubscribe@googlegroups.com
>>
>> Adult contents, Spamming, Immoral & Rudish talk, Cell number, Websites &
>> Groups links specially in paper days are strictly prohibited and banned in
>> group.
>>
>
> --
> Join us at facebook: https://www.facebook.com/VU.Study.Corner
>
> Group Link: http://groups.google.com/group/VU-Study-Corner?hl=en
>
> Group Rules: http://groups.google.com/group/VU-Study-Corner/web/group-rules
>
> Unsubscribe: VU-Study-Corner+unsubscribe@googlegroups.com
>
> Adult contents, Spamming, Immoral & Rudish talk, Cell number,  Websites &
> Groups links specially in paper days are strictly prohibited and banned in
> group.
>

--
Join us at facebook: https://www.facebook.com/VU.Study.Corner

Group Link: http://groups.google.com/group/VU-Study-Corner?hl=en

Group Rules: http://groups.google.com/group/VU-Study-Corner/web/group-rules

Unsubscribe: VU-Study-Corner+unsubscribe@googlegroups.com

Adult contents, Spamming, Immoral & Rudish talk, Cell number,  Websites & Groups links specially in paper days are strictly prohibited and banned in group.

--
Join us at facebook: https://www.facebook.com/VU.Study.Corner
 
Group Link: http://groups.google.com/group/VU-Study-Corner?hl=en
 
Group Rules: http://groups.google.com/group/VU-Study-Corner/web/group-rules
 
Unsubscribe: VU-Study-Corner+unsubscribe@googlegroups.com
 
Adult contents, Spamming, Immoral & Rudish talk, Cell number, Websites & Groups links specially in paper days are strictly prohibited and banned in group.

No comments:

Post a Comment