0% found this document useful (0 votes)
42 views

Construction Cost Estimation System

1) The document describes a construction management system that will automate the cost and time estimation of construction projects. 2) It involves parsing a input file containing project details, filtering for projects starting in the current financial year, calculating estimated costs and durations, and persisting the updated records to a database. 3) The requirements and components like the input file format, date conversion, database connection, and exception handling are specified.

Uploaded by

Sudheer Ponnada
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Construction Cost Estimation System

1) The document describes a construction management system that will automate the cost and time estimation of construction projects. 2) It involves parsing a input file containing project details, filtering for projects starting in the current financial year, calculating estimated costs and durations, and persisting the updated records to a database. 3) The requirements and components like the input file format, date conversion, database connection, and exception handling are specified.

Uploaded by

Sudheer Ponnada
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Construction Management System

IMPORTANT INSTRUCTIONS

1. Please read the document thoroughly before you code.


1. Import the given skeleton code into your Eclipse.
1. Use Java 8 for solving the code challenge.
1. Run the database script provided to set up your database.
1. You have to test the code and ensure there are no compilation
errors before submission

I. Business Scenario:
A leading construction company wants to expedite their process of cost estimations for their various
ongoing projects. The company wants to automate the process of this cost & time estimation aspect, for
all those projects starting this financial year.

The construction project details of the company are stored in a .txt file (as a comma separated fields).
This file contains the details/records of the projects under various categories like Commercial,
Residential and Infrastructural. The cost and Time duration in months are to be calculated for all those
projects starting this financial year.

The proposed system is supposed to pick up the project details which are commencing in the current
financial year from the source data and calculate the cost & duration of the project in months, based on
the data provided in the requirement specification. After calculating, the system needs to persist those
records in the database.

II. Functional Requirement Specification:

Req. # Req. Name Req. Description


1 Parse Input The input file has to be parsed and Project records need
to filter based on the start date of the projects.
2 Update the Projects The Project’s Cost & Duration have to be calculated and
estimated Cost and then the modified records need to be saved in the
duration and persist the database.
data in the database

III. Skeleton File for Development


Construction Management System

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

IV. Use case Diagram

V. Technical Requirements

For both the functional requirements 1 and 2, component specification and method specification are
given below. Please follow the same order to implement them using the code skeleton.

(1) A. Component Specification:

Requirement Parse Input


Construction Management System

Name
Component Reads the input text file, and convert the data into objects
Definition
Files Included ConstructionProjectEstimationService.java, ApplicationUtil.java, ConstructionProject.java,
(refer inputfeed.txt,ConstructionEstimationException.java
Skeleton)
Responsibilities  Reads the input file.
 Perform validation to check if the Construction Project is planned for the
current year.
 Build and return the ConstructionProject value object.
Resources Input File Name: inputfeed.txt
File Structure:
<projectId>,<plannedDOStart>, <typeOfProject>, < structure>, <areaInSqFt>,
<estimatedCostInlac>, <estimatedTimeInMonths>

Design a. Input file format is .txt and is comma separated (Sample rows are added. You can add
Constraints any number of rows to test your service class, from main method.
b. Do not hard code the input file name inside any method .It has to be referred from the
input argument only as per code skeleton.
c. From the given input file, filter the Construction Project details, which are planned for
the current financial year.
d. Assume that the Currency related fields are in INR.
e. Assume that the Date of Start in the file will be in the format yyyy-MM-dd.
f. Do not change the data types of the value object given in POJO.
g. Always convert the date of start value to java.util.date with format, yyyy-MM-dd
before setting in ConstructionProject value object.
h. Use ApplicationUtil.java for reading file, performing date operations, etc.

Note: Sample rows are given in the input file. You can add any number of rows to test your
service class, from main method.
Process Flow a. The app will be invoked by calling the ConstructionProjectEstimationService.
addConstructionProjectDetails with the inputfeed (.txt file)
b. Read the file using File I/O or Java Streams in ApplicationUtil.readFile method
c. Return a list of Construction Project rows from input file, from the readFile method
considering records which are passing the current financial year check constraint.
d. Code the method ConstructionProjectEstimationService. buildConstructionProjectList.
Call the readFile method from this method. Read every line from the list returned by
readFile method, split the records based on comma separator and use
e. For each record calculate the time and cost involved by calling the appropriate service
method
f. The method should return a list of ConstructionProject objects.
g. Use the ApplicationUtil. convertStringToDate method to convert the date from String
Format to java.util.Date format (yyyy-MM-dd).
h. Build the ConstructionProject Value Object from the values obtained in every line
Construction Management System

(Check the Input file format in Design Constraints row)

Exceptional While doing File I/O in the ApplicationUtil.readFile method, catch all exceptions and throw
Conditions application specific exception, ConstructionEstimationException.

(1) B. Method Specification:

Class Name Method Name Input Parameters Output


Parameters
ConstructionProjectEstimation addConstructionProjectDetails String inputFeed boolean
Service
ApplicationUtil readFile String fileName static
ArrayList<String
>
ConstructionProjectEstimation buildConstructionProjectList List <String> ArrayList
Service consProjectRecords <ConstructionPr
oject>
ApplicationUtil convertStringToDate String input Date Date

(2) A. Component Specification:

Requirement Persist Data into Database


Name
Component Helps to calculate the costEstimation & timeEstimation values and add the changes made to
Definition the database.
Files Included ConstructionProjectEstimationService.java, ApplicationUtil.java, ConstructionProject.java,
(refer Skeleton) DBConnectionManager.java, ConstructionEstimationException
Responsibilities Updates ConstructionProject object, based on area, structure and typeOfProject. Persists all
ConstructionProject details to the database.
Design a. The database.properties has connection details required to connect to the backend
Constraints b. 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 user name based on local settings.
c. Use only JDBC to establish Database connection
d. Assume the location of the property file will be always as given in the skeleton.
e. Don’t Hardcode the connection string to establish database connection. Read it from
property files.
f. Use Prepared Statement to insert records
g. Close all the resources after use
h. Catch all database related exception and throw Application specific exception only
from DAO or from DBConnectionManager class. There has to be a private constructor in
Construction Management System

DBConnectionManager class, to load the database property file and to establish a


database connection using JDBC
i. Rollback the Insert if any SQL exception has occurred. Throw application specific
exception, ConstructionEstimationException
j. Calculate CostEstimation & TimeEstimation, based on the constraints in the table
given below

Project Type Structure Cost TimeInMonths/1000sqft


PerSqFt(Rs)
Commercial Shopping 2600 0.23
Complex
Commercial ResApartments 2750 0.24
Commercial Community 2600 0.2
Hall
Infrastructural Bridge 10000 0.25
Infrastructural FlyOver 14000 0.22
Infrastructural UnderPass 8000 0.25
Residential House 2250 0.26
Residential Apartments 2500 0.24
Residential Villa 2750 0.23

Based on the type of the Project & the Structure , according to the required area of
Construction, the cost & time have to be calculated based on the base data available in the
above table:
For eg. If the Project Type is “Commercial” and the structure is “Shopping Complex” the cost
incurred for the construction of per sq. ft is Rs.2600 and the time taken for the construction
of the 1000 sq ft of the same project is 0.23 Months, calculation has to be performed on the
similar basis i.e Pro rata basis depending upon the type and the area of construction.

Resources database.properties – has connection details, used to establish database connection.


Process Flow a. Modify the ConstructionProjectEstimationService.buildConstructionProjectList
method (refer the above section) then set updated costEstimation & timeEstimation
values to ConstructionProject objects.
b. Use ConstructionProjectEstimationService. estimateTimeAndCostForConstruction ()
method to calculate the costEstimation & timeEstimation based on the
Structure,TypeOfConstruction & areaInSqFt passed as parameters,
c. The method ConstructionProjectEstimationService. buildConstructionProjectList must
return the list of ConstructionProject objects with updated costEstimation &
timeEstimation fields, let’s persist the records as it is.
d. After reading file, building records as List<ConstructionObject>, call the
CostAndTimeEstDAO. insertConstructionProject method to insert values to database. You
may have to convert the java.util.date to java.sql.date before storing to database.
e.If Insert has happened successfully, return true; false otherwise.
Construction Management System

f. Use getConstructionProjectsData to fetch the updated records and display.


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

(2) B. Method Specification:

Class Name Method Name Input Output Parameters


Parameters
ConstructionProjectEstimationSer estimateTimeAndCostForConstructi String double[]
vice on() projectType,Strin
g
structure,double
areaInSqFt
ConstructionProjectEstimationSer buildConstructionProjectList List <String> ArrayList
vice consProjectRecor <ConstructionProject
ds >
DBConnectionManager DBConnectionManager() NA NA
DBConnectionManager getInstance() NA DBConnectionManag
er
CostAndTimeEstDAO insertConstructionProject List< boolean
ConstructionProje
ct >
Note: You are allowed to modify 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 PMD rules in Eclipse or any other IDE
that you use.

Sample Output Data:


CP001 2021-11-17 Residential Apartments 100000 250000000 24
CP002 2021-09-15 Commercial ShoppingComplex 200000 520000000 46
CP003 2021-08-10 Residential Villa 1000000 2750000128 230
CP004 2021-07-13 Commercial CommunityHall 100000 260000000 20
CP005 2021-08-12 Infrastructural FlyOver 1000000 14000000000 220

You might also like