Suppose you have a text file named admission.txt that consists of applicants who have applied for admission in an IT institute. Data of file consist of multiple rows and each row represents one record separated by comma character in the following order. First Name Last Name CNIC Inter marks Percentage Age Phone Number Subjects in Inter (Major Subjects)
Suppose you have a text file named admission.txt that consists of applicants who have applied for admission in an IT institute. Data of file consist of multiple rows and each row represents one record separated by comma character in the following order.
- First Name
- Last Name
- CNIC
- Inter marks Percentage
- Age
- Phone Number
- Subjects in Inter (Major Subjects)
There are 200 available seats for current session and first come first served model will be followed. Admission Eligibility criteria is:
- Percentage must be greater than 60
- Age must be less than 30
- Candidate must have studied Math/Stat or Computer in Inter.
You are required to read and process the text file in a way that data of qualified candidates should be copied in a file qualified.txt. The data of new file must be comma separated and in the following format:
- Full Name
- Phone Number
- Eligibility (Yes or NO)
- Rejection Reason (Over Age, Low percentage, Missing Prerequisite, All seats reserved or NA)
Sample admission.txt file format
FirstName,LastName,CNIC,InterPercentage,Age,PhoneNo,Subjects Ali,Khan,12345-1234561-7,55,25,370-884724,CS-Phy-Math Ahmed,Ali,12345-1234561-9,70,20,371-818734,ENG-BIO-CHM Ashraf,Khan,10345-1234211-8,65,22,388-828672,CS-Phy-Math Sajid,Sheikh,23455-1234301-8,90,34,377-814794,CS-Stat-Math |
Sample qualified.txt file format
Name,PhoneNo,IsEligible,Rejection Reason Ali Khan,344-8184724,No,Low Percentage Ahmed Ali,341-8184734,No,Missing Prerequisites Ashraf Khan,344-8184724,Yes,NA Sajid Sheikh,344-8184724,No,Over Age |
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)