Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

AOA. any one know about Assignment 03 of cs201 plz share it

Views: 9713

Replies to This Discussion

#include
#include
using namespace std;

int get_key(string a_lines)
{ int key = 0;
key += a_lines.length();
return key; }

bool findkey(string a_lines)
{ int answer = a_lines.find("%");
if(answer >= 0)
{ return 1; }
else
{ return 0; } }
bool readkey(string a_lines)
{

}
main()

{ ifstream infile;
ofstream outfile;
char fName[100];
string line;
string lines;
int option;
cout "Enter the name of text file in current directory:";
cin >> fName;
infile.open(fName, ios::in); // opening file in input mode
bool jump = true;
bool answer;
if(!infile)
{ cout "file not found choose 1"; }
else
{ while(!infile.eof())
{ getline(infile, line);
lines += line; }
infile.close();
do
{ cout "\nOperations on text file";
cout "\n1.Protect my text file";
cout "\n2.check security of my text file";
cout "\n1.Enter your choice (1/2)";
cin >> option;
switch(option)
{ case 1:
if(findkey(lines))
{ cout "already protected";
cout " and return " findkey(lines);
infile.close();
jump = false;
break; }
else
{ outfile.open(fName, ios::app);
outfile "%";
outfile get_key(lines);
cout "key added";
cout "and return " findkey(lines);
jump = false;
outfile.close();
break; }
case 2:
if(findkey(lines))
{ cout "file is protected using option 2";
cout "and return " findkey(lines);
jump = false;
break; }
else
{ cout "file is not protected please protect file";
cout "and return " findkey(lines);
jump=false;
break; } } }



while(jump == true);
system("pause");
} }

video demo ka b bta dey k kesy dena hai?????????????????? plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

#Mannoh #Billi hmain demo nai dena sir ko just .cpp wali file send krni hai demo sir wala hm nay dekhna hai phr us trha se apnay program ko check krna hai 5 cases hain total.

check this and tell me theak hai ya nai mujse sahi run nai ho rahi

Attachments:

iss mein file name kia likna ha?

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service