求助一道题!
Problem statement
You must work out a class to handle a simple database that is persistently stored in a single text file. The lines of the text file contain the following 'fields' : name, e-mail address, telephone number(s), and attendance to class. A sample file is made available in computer readable format for testing purposes.
The class must have member functions for
• displaying the contents of the database
• retrieving the total percentage of attention out of 19 meetings
• retrieving this percentage for a student by the name of the student
• modifying the e-mail address by name of student
• adding a new student
Modified values must be recorded in the file.
You may optionally work out member functions to
• display the database ordered by name
• remove a student
• retrieving the entries one by one in the client (test driver)
test file:
Inesa vestbam@hotmail.com 40950908 16
Yasir Yasir142@hotmail.com 22401557 15
Adey Adey@sol.dk 28154118/32966667 8
Bi bxbell@hotmail.com 26747237 9
BoHu DuBoHu@hotmail.com 28925895 7
Chen HaveyChen@hotmail.com 60618956 18
Davis Dnpro@hotmail.com 36380416 7
Esteban tebiches@hotmail.com 32876087 18
Devine Ebeny99@yahoo.com 26702599 16
Sylvie esovy@yahoo.co.uk 22502441 19
Pablo Pablofog@hotmail.com 40924546/46974549 15
Vara Vara_prasad81@rediffmail.com - 14
Ronny molinn@strik.is 23679516 19
Fannar fannar@mi.is 29249885 17
Jurgita jurgitakopytina@yahoo.com 20858105 19
Ibrahim Walibru@hotmail.com 22528988 18
Kristina Kristina@surfmail.dk 27291599 19
Loay Loay@12mail.dk 44974800-132/25710759 17
Mariam mariammir17@hotmail.com 22899845 19
Regina Reginka@centras.lt 26367456 15
Maral Marhei2@niels.brock.dk 48160792 15
Ludi Ludmem@hotmail.com 26220974 14
Ernest ernjum@niels.brock.dk 32582717 11
Sheng Shengqian2008@yahoo.com.cn - 10
Pavan pavangadiraju@hotmail.com - 7
You youchenxi@hotmail.com 22461968/32876651 9
Li Like1977@hotmail.com 25136251 5
Yang Zhaoyang1982@hotmail.com 26539466 9
Vitaliy - - 2