- Back to Home »
- CS201 Assignment no 3 Full Solution spring 2013
Posted by : Anonymous
Friday, 21 June 2013
Problem Statement:
Write the C++ program having class name studentinfo, that is used to
store the VU student information: This class should store your VUID, campus id, name and father name in the
following character type data members:
Data members:
Studentinfo class should have the parameterized constructor that is
used to initialize the data members of the studentinfo class,
Studentinfo class should have following member functions.
Storefile() member function should store the value of all data
members in the text file named “record.txt”, on separate lines in the text
file as follows:
ms120400400
Vlhr02
Muhammad Hussain
Muhammad Ali.
Display() member function reads your VUID, campusID, name and father
name from the file named “record.txt”, stores them in the respective data
members and displays the record.
Hint:
In main() function,
create the object of the class by using parameterized constructor and then
call the storefile() member function to store the record of all the data members
in the text file. Finally call the display() function to read the data from
text file and store it in the respective data members and display all the
records.
Sample Output:
Note:
You have to upload only .cpp file of your assignment, do not send your
assignment in .txt, .zip, .rar .doc or .docx format.
|