Assessment 1
Assessment 1
Project Assessment
The objective of this assessment is to check your ability to complete a project as per the
provided “Project Design”.
1. Write the source code for the classes, methods and packages EXACTLY as mentioned in
the “Project Design” section.
2. Ensure that the names of the packages, classes, methods and variables EXACTLY
MATCH with the names specified in the “Project Design” section.
3. Understand the project requirements and ACCORDINGLY WRITE the code and logic in
the classes and methods so as to meet all given requirements.
1. You are expected to create your project locally using eclipse (or any other IDE) on your
desktop.
2. Once you are ready with the code, you should upload the src folder of your project
in .zip format, using the “Upload Zip File” button.
IMPORTANT NOTE 1 : The extension of the zip file should be ONLY .zip (any other zip formats
such as .7z will produce unexpected results)
IMPORTANT NOTE 2 : The .zip file should contain zip of ONLY the src folder structure from
your project. (If the zip file has anything other than the src folder structure, the result will be
unexpected. Do not zip the entire project folder structure. Just do the zip of the src folder
structure and upload it)
IMPORTANT NOTE 3 : The name of the .zip file should be <your employee number>.zip For
e.g., if your emp no. is 12345, the zip file should be named 12345.zip.
3. After uploading the zip file, you can click on “Compile & Test” button and the
assessment engine will compile your source code and test it using its pre-defined test-cases.
4. If some of the test-cases fail, you can make the fixes in your source code locally on your
desktop, and again repeat the above two steps.
5. Once you are finished with all the fixes, you can click on “Final Submission” button,
which will show you the final result/score.
NOTE that –
6. The assessment engine will create objects and invoke methods as per the project
design, and while doing so, it will use your packages, classes and methods. If your packages,
classes and methods have a name mismatch or method prototype mismatch w.r.t the
expected “Project Design”, the tool will show it as an ERROR. If your packages, classes and
methods match as per the names but do not perform the expected functionality, the tool
will show it as a FAILURE.
7. Unless specified in the Project Design, DO NOT use System.exit(0) anywhere in your
code. Using System.exit(0) in your project code will cause the CPC test engine to exit and it
will not be able to run all test-cases.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Project Objective:
Create a console based Java application that would allow the Admin of a training Institute to
add and view Candidate information details as per the design specifications given below.
The data received from the user (Admin) will be stored in database and retrieved when
required.
Project Design:
A. Database Design:
1. Create a new user in database [ To be done in the backend by using sql commands ]
a) Note: Do NOT use the default scott/tiger account of oracle for this project. You will
have to create a new user in the below mentioned format.
b) Username/password : B<batchnumber><employeeid>
For example, if your batch number is 39806 and Employee number is 12345, then the oracle
user should be B3980612345 and the password should be B3980612345
c) For JDBC connection, only use XE as service name and 1521 as port number
e) Commit;
f) Exit;
3. Create Table [ To be done using sql commands, after logging-in as the new user that
has been created in above step ]
Name Varchar2(15)
M1 Number(3)
M2 Number(3)
M3 Number(3)
Result Varchar2(15)
Grade Varchar2(15)
4. Create Sequence:
B. System Design:
com.wipro.candidate.dao This package will contain the class that will do the database
related JDBC code.
Package: com.wipro.candidate.util
Package: com.wipro.candidate.bean
Package: com.wipro.candidate.dao
· If the insertion is
successful, then a String
“SUCCESS” should be
returned, else a String
“FAIL” should be
returned.
· If any JDBC
exception such
as SQLException occur,
this function should
return “FAIL”
· In any of the
criteria’s “PASS/FAIL/ALL”
if there are no matching
records then the
function should
return null
· In case of
any JDBCExceptions in
the database then
a null value needs to be
returned
· CandidateID is a
combination of first 2
letters of
name in uppercase follo
wed by 4 digit number
that will be generated
by the oracle sequence
CANDID_SEQ.
· The function
should return the
generated Candidate id.
Package: com.wipro.candidate.service
public static void main(String[] args) The code that is needed to test your program
goes here. A sample code is shown at the end
of the document.
Ø candBean is null
Ø candBean’s name is empty String
· Compute Candidate ID
Ø M1=mark1 of candBean
Ø M2=mark2 of candBean
Ø M3=mark3 of candBean
Test Cases:
Below are the actual set of test cases that the CPC test engine will run in the background.
Please ensure that the conditions mentioned in these test-cases are handled by your class
design.
Test 6: Test for checking correct computation of PASS, FAIL and grade
Test 7: Test for null value generation for different criteria (PASS/FAIL/ALL)
Main Method:
You can write code in the main method and test all the above test cases. A sample code of
the main function to test the first test case is shown below for your reference.
System.out.println(result);