0% found this document useful (0 votes)
235 views4 pages

Important Instructions: College Admission

The document provides instructions for developing a college admission application. It includes requirements to parse an input file of applicant records, validate the records based on eligibility criteria, build applicant objects, and insert valid records into a database. The application is to be developed using the provided skeleton code and database script. Requirements include parsing a comma-separated text file, validating total marks and per-subject minimums, calculating admission fees by stream, and inserting valid records into the database while handling exceptions.

Uploaded by

ANWESHA DUTT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
235 views4 pages

Important Instructions: College Admission

The document provides instructions for developing a college admission application. It includes requirements to parse an input file of applicant records, validate the records based on eligibility criteria, build applicant objects, and insert valid records into a database. The application is to be developed using the provided skeleton code and database script. Requirements include parsing a comma-separated text file, validating total marks and per-subject minimums, calculating admission fees by stream, and inserting valid records into the database while handling exceptions.

Uploaded by

ANWESHA DUTT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COLLEGE ADMISSION

IMPORTANT INSTRUCTIONS
1. Please read the document thoroughly before you code.
2. Import the given skeleton code into your Eclipse.
3. Use Java 8 for solving the business requirement.
4. Run the database script provided to set up your database.
5. You have to test the code and ensure there are no compilation errors before submission.

A. BUSINESS SCENARIO

MKM College of Engineering is one of the top Engineering colleges in the city. They are
starting their new admissions next month. To scrutinize the admission process, the college has kept an
eligibility criterion. The college fee structure changes with each stream. The admission system
should check the valid applicants and calculate the fee structure based on the stream and drop the
records in the database.

B. FUNCTIONAL REQUIREMENT SPECIFICATION

Sl No. Business Requirement Business Description


1 Parse Input The input file has to be parsed and the applicant records need to be
filtered based on their mark criterion.
2 Insert the validated records The valid applicant records are inserted into the database
into the database

C. SKELETON FILE FOR DEVELOPMENT

Import the attached skeleton code into your eclipse project and implement the required
functionalities. The skeleton also has a SQL file that can be used to set up your database.

D. TECHNICAL REQUIREMENTS

For both functional requirements 1 and 2, component specifications and method


specifications are given below. Please follow the same order to implement them using the code
skeleton.

D.1.1 Component Specification:

Requirement Name Parse Input


Component Reads the input text file and converts the data into objects
Definition
Files Included AdmissionService.java, ApplicationUtil.java, Applicant.java, inputfeed.txt,
(refer Skeleton) MarkEligibilityException.java
Responsibilities Reads the input file, filters the records based on the eligibility criteria on the
total marks, and then builds the Applicant object and returns it.
Design Constraints  The input file format is .txt and is comma-separated (Sample rows
are added. You can add any number of rows to test your service
class, from the main method)
 Do not hard code the input file path inside any method – has to be
COLLEGE ADMISSION

used from the input argument only as per the code skeleton.
The file structure is similar to what is mentioned below:
<ADMISSION_NO>,<APPLICANT_NAME>,<DATEOFBIRTH>,
<GENDER>,<PHYSICS_MARK>,<CHEMISTRY_MARK>,
<MATHS_MARK>, <PREFERRED_STREAM>
Resources inputfeed.txt is the input file that must be parsed. The file, along with the file
location will be sent as an argument to the
AdmissionService.addAdmissionList() method. File location/path must not
be hardcoded.
Process Flow  The application will be invoked by calling the
AdmissionService.addAdmissionList() with the input feed (.txt file).
 Read the file using File I/O or Java Streams in ApplicationUtil.
 readFile() method returns List <String> of records, that was read
from the file; It should filter based on the valid mark criteria for
admission using the method checkFor_Eligibility().
Guidelines for Criterion for eligibility of admission:
1. The total marks summing physics, chemistry, and maths should be
greater than 224.
2. Each subject should have a minimum mark of 50.

 Code the method AdmissionService.buildAdmissionList() pass the


output of the readFile method to this method as an argument.
 In the method AdmissionService.buildAdmissionList() read the list
returned by the readFile method, split the records based on a comma
separator, and return the ArrayList of Applicant records.
Exceptional While doing File I/O in the ApplicationUtil.readFile method, catch all
Conditions exceptions and application specific exception thrown from
checkFor_Eligibility() method.

D.1.2 Method Specification:


Class Name Method Name Input Parameters Output Parameters
AdmissionService addAdmissionList () String inputFeed boolean
ApplicationUtil readFile() String fileName static List<String>
ApplicationUtil checkFor_Eligibility double phy,double static boolean
chem,double maths
ApplicationUtil stringToDateConverter String stringDate static Date
ApplicationUtil utilToSqlDateConverter java.util.Date utDate static java.sql.Date
AdmissionService buildAdmissionList() List <String> static ArrayList
AdmissionRecords <Applicant>

D.2.1 Component Specification:

Requirement Name Persist Data into Database


Component Helps to drop the records into the database
Definition
Files Included AdmissionService.java, ApplicationUtil.java, Applicant.java,
COLLEGE ADMISSION

MarkEligibilityException.java, DBConnectionManager.java, AdmissionDAO.java


(refer Skeleton)
Responsibilities Updates valid applicant records based on the eligibility criterion for admission.
Inserts all the applicant records validated to the database.
Design Constraints  The database.properties have connection details required to connect to the
backend.
 Do not change the keys of the property files, you can update the values based
on the local database settings. For example, do not change the key,
db.username. Rather you can have any value as a user name based on the
local settings.
 Use only JDBC to establish a Database connection.
 Assume that the location of the property file will be always as given in the
skeleton.
 Don’t hardcode the connection string to establish a database connection.
Read it from the property files.
 Use a Prepared Statement to insert records.
 Close all the resources after use.
 Catch all the database-related exceptions and throw an Application-specific
exception only from the DAO or from the DBConnectionManager class.
There has to be a private constructor in the DBConnectionManager class, to
load the database property file and to establish a database connection using
JDBC.
 Rollback the Insert if any SQL exception has occurred. Throw an
application-specific exception, MarkEligibilityException.

The fee structure for admission based on stream selection:


Stream Admission Fee (In Rs)
CSE 1,00,000
IT 1,00,000
AERO 1,00,000
MECH 75,000
CIVIL 75,000
EIE 50,000
EEE 50,000
ECE 50,000
Note: Stream is case In-sensitive.
Resources database.properties – has connection details, used to establish database connection.
Process Flow  Modify the AdmissionService.buildAdmissionList() method set the
Applicant list-objects.
 To calculate the admission fee based on the stream selection, use the
AdmissionService.calculateAdmissionFee() method and set the value to
the object using the appropriate setter.
 After reading the file, building records as ArrayList<Applicant>, call the
AdmissionDAO.insertAdmissionList() method to insert values to the
database. The database will contain only validated applicant records.
 If the insert has happened successfully, return true; otherwise, false.
COLLEGE ADMISSION

Exceptional While working with DAO methods catch all exceptions and throw an application-
Conditions specific exception, MarkEligibilityException.

D.2.2 Method Specification:


Class Name Method Name Input Parameters Output Parameters
AdmissionService calculateAdmissionFee String static double
streamChoice
DBConnectionManager DBConnectionManager() NA NA
DBConnectionManager getInstance() NA static
DBConnectionManager
AdmissionDAO insertAdmissionList() List <Applicant> boolean
Admission_List

Note: You are allowed to modify the input file text to incorporate more test data for various test
scenarios/boundary conditions. Test your application by invoking the service methods from the main class,
main () method. Follow Java Naming Conventions, test the code quality by running the PMD rules in Eclipse
or any other IDE that you use.

E. SAMPLE OUTPUT (IN DB):

E02,Vivian Raj,18-08-2002,M,75,75,75,EIE,50000
E03,Visal Philip,18-09-2002,M,80,80,80,CIVIL,75000
E05,Jisha Kandaran,01-02-2002,F,74,76,75,ECE,50000
E07,Susan Philip,23-10-2002,F,90,91,95,EEE,50000
E08,Manohar Kumar,18-11-2002,M,80,80,82,CSE,100000
E09,Chrystal Siva,06-04-2002,F,76,75,76,IT,100000
E10,Deena Davis,05-06-2002,F,74.5,76.5,74,MECH,75000
E11,Adithya Immanuel,03-03-2002,M,75,76,78,AERO,100000

You might also like