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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.                                                                                                                                                                                               

  1. First Name
  2. Last Name
  3. CNIC
  4. Inter marks Percentage
  5. Age
  6. Phone Number
  7. 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:

  1. Percentage must be greater than 60
  2. Age must be less than 30
  3. 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:

 

  1. Full Name
  2. Phone Number
  3. Eligibility (Yes or NO)
  4. 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

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education