We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Please read the following instructions carefully before submitting assignment.

It should be clear that your assignment will not get any credit if:

 

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • Assignment is copied(partial or full) from any source (websites, forums, students, etc)

 

 

Objective

 

The objective of this assignment is:

  • Learn to code, edit, compile and execute C++ program.
  • Learn to manipulate and navigate through text files.
  • Learn to create and use user defined functions.
  • Learn to use string manipulation functions.

Guidelines

 

  • Code should properly be indented and well commented.
  • Follow C/C++ naming conventions while using variables, functions etc.
  • Use only Dev-C++ for this assignment. If you are using any other tool then mention it at top of your code file as comments.

 

Assignment Description

 

In this assignment, you are required to write c++ code that will protect the provided text file using the protection mechanism given in guidelines. It will also check the security of file and if any change is made in the contents of protected file, it will point out the file as changed.

 

Protection mechanism:

The program will protect the file by generating a protection key on the basis of contents of the file. The key will be saved at the end of the file with “%” symbol as prefix. This key will be used to detect either the file contents are changed or not e.g. if file contents are changed the new key generated will not match the existing one, leading to conclusion that file contents have been changed.

 

Solution guidelines

The program should operate in following sequence.

  • Program will prompt the user to enter the file name in current directory.
  • System will show a menu with two options:
    • Protect the file
    • Check security status
  • In case user selects the first option (i.e. protect the file), the system will perform the following steps:
    • Read the file
    • Check if the file is already protected or not.
    • In case if file is not protected, program will protect it by the protection mechanism defined above.
    • If file is already protected, system will display appropriate message and exit.
  • If user selects the second option (i.e. check security status), the system will perform following steps:
    • Read the entire file and if key does not exist (i.e. file is not already protected), program will display the message to protect the file first and display menu.
    • If file is already protected, the system will read the contents along with the already existing key. On the basis of contents read, a new key will be generated. If this new key and the existing one (read from the file) do not match, it means that the contents of protected file are changed and vice versa.

 

Important note

A text file (data.txt) is attached with assignment, use it for protection checking. Video file (Output-Demo.mp4) of desired function is also attached with assignment. Watch the demo video carefully to understand the required functionality (output) of program. Your program should work as per functionality performing in demo video file. You do not need to send text file with your solution. Just upload .cpp file from your LMS account. For any query related to assignment no. 3 contact us at cs201@vu.edu.pk.

Submission

You are required to submit your solution C++ program through LMS i.e. .cpp file. 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 7155

Replies to This Discussion

Cs201 Assignment No 3 

Attachments:

access  denied on this server plz upload through dropbox or anyother hosting\

Need some help on 3rd assignment

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

plz help about assignment

i don't understand 

I've solved the problem , 

If anyone needs help in algorithm or understanding what exactly teacher asked to work I can help , but remember I wont give source code like other will only help you and teach you about the problem , so only ask from me if you have passion to learn programming

Regards,

plase tell me kon sy leactures ko main smj k dykh to mujy is assigment ko solve krny main asani ho gi?

Asalalm o alikum 

please help me out to solve this assignment ...i will not ask for code but tell me the the algorithm ....

ok here are the things you have to do , 

to protect the file create a mechanism that will generate a unique key based on the written data , like , the data in the file is "I am a programmer" then the key will be 49

and if the data is "I am a software engineer" the key will be 80 , you have to think a way how to do that

then write that key in the end of the file using app mode

and in checking the simple thing you have to do is read the key and check via the mechanism you have generated the key that data is still the same or not and then display the msg accordingly on console :)

thank you .... if i want to use a function so how would i pass the address of the file as an  argument.... 

lecture 18 and 19  and a lil bit of thinking :p

RSS

Latest Activity

+M.Tariq Malik replied to +M.Tariq Malik's discussion ENG502 Introduction to Linguistics GDB No 01 Fall 2020 Solution / Discussion in the group ENG502 Introduction to Linguistics
6 minutes ago
+M.Tariq Malik liked +M.Tariq Malik's discussion ENG502 Introduction to Linguistics GDB No 01 Fall 2020 Solution / Discussion
6 minutes ago
+M.Tariq Malik added a discussion to the group ENG502 Introduction to Linguistics
7 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC101 Introduction to Sociology Assignment 01 Fall 2020 Solution / Discussion in the group SOC101 Introduction to Sociology
9 minutes ago
+M.Tariq Malik liked +M.Tariq Malik's discussion SOC101 Introduction to Sociology Assignment 01 Fall 2020 Solution / Discussion
10 minutes ago
+M.Tariq Malik added a discussion to the group SOC101 Introduction to Sociology
10 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion PSY101 Assignment 01 Fall 2020 Solution / Discussion in the group PSY101 Introduction to Psychology
14 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion PSY101 Assignment 01 Fall 2020 Solution / Discussion in the group PSY101 Introduction to Psychology
14 minutes ago
Profile IconJunaid [MAF] and Ali Fahad joined +M.Tariq Malik's group
25 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion PSY401 Clinical Psychology Assignment 01 Fall 2020 Solution / Discussion in the group PSY401 Clinical Psychology
39 minutes ago
HAFIZA AREESHA ASLAM added 2 discussions to the group ECO403 Macroeconomics
45 minutes ago
HAFIZA AREESHA ASLAM replied to HAFIZA AREESHA ASLAM's discussion first assignment in the group ECO402 Microeconomics
54 minutes ago
HAFIZA AREESHA ASLAM added a discussion to the group ECO402 Microeconomics
55 minutes ago
Profile IconM Abid Inayat, Ayesha, Rabi Rajput and 13 more joined Virtual University of Pakistan
59 minutes ago
Naser Javed (BBIT-8) liked +M.Tariq Malik's discussion How To Prepare for Grand Quiz (Mid Term Quiz) Of Virtual University Of Pakistan
1 hour ago
Anmol Mughal and Saarim are now friends
2 hours ago
Muhammad Bilal replied to +M.Tariq Malik's discussion MGT301 Principles of Marketing Assignment 01 Fall 2020 Solution / Discussion in the group MGT301 Principles of Marketing
2 hours ago
Muhammad Bilal replied to Muhammad Faizan Alam's discussion STA301 Assignment No.1 | FALL 2020 | Due Date: 8th December, 2020 in the group STA301 Statistics and Probability
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion EDU201 Learning Theories Assignment 01 Fall 2020 Solution / Discussion in the group EDU201 Learning Theories
3 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion GSC201 Teaching of General Science Assignment 01 Fall 2020 Solution / Discussion Due Date: in the group GSC201 Teaching of General Science
3 hours ago

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

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

.