Java Project
Java Project
Java Project
Version 1.0
Prepared By / Last
Reviewed By Approved By
Updated By
Name
Role
Signature
Date
Table of Contents
1.0 Introduction 3
1.1 Purpose 3
1.4 Scope 3
3.2.1 Parse data and generate the average annual rainfall for all the cities 7
3.2.2 Extract the names of the cities with heavy rainfall 11
4.0 Submission 12
The Meteorological Department has the following tasks that must be automated.
1. Parse data and calculate the average annual rainfall of all the cities
Nil
1.4 Scope
The scope of the system is explained through its following modules
1. Parse data and calculate the average annual rainfall of all cities
1. Java 8
2. MYSQL 5.1
Note: All the required hardware and software is provided in the TekStac platform
1 Parse data The average monthly rainfall Admin The admin of the
and in each city and the other meteorological
calculate details of the city are stored department is
the average in a flat file. Retrieve the data responsible for
annual from the file and calculate parsing the data and
rainfall of all the average annual rainfall calculating the
cities for each city based on its average annual
monthly rainfall. rainfall for all the
cities
2 Extract the The average annual rainfall of Admin The admin of the
names of the each city is stored in the meteorological
cities with database, the meteorological department is
heavy rainfall department will find the responsible for
maximum rainfall value and retrieving the average
display the city details which annual rainfall of each
has the maximum rainfall city from the
from the database. database and
Identifying the cities
with the maximum
rainfall
Design Constraints:
Use MYSQL database to store the data. The database name should be
“RainfallReport”.
The above table has been already created. To create the table in your
local machine, the script is available in “script.sql” . The table names and
the column names should be the same as specified in the table
structure.
[AllCityMonthlyRainfallFormat:
cityPincode,cityName,JanRainfall,FebRainfall,MarRainfall,AprRainfall,MayRainfall,Ju
nRainfall,JulRainfall,AugRainfall,SepRainfall,OctRainfall,NovRainfall,DecRainfall]
From the AllCityMonthlyRainfall.txt file, read the details, parse the data and
construct an AnnualRainfall object for each record in the file, then calculate the
averageAnnualRainfall of each city based on the conditions mentioned below:
Average Annual Rainfall = (sum of all monthly rainfall of a city)/number of months
30, 15.5, 12, 10, 15, 20.9, 21, 22, 20, 18.6, 15, 10
After calculating the averageAnnualRainfall, store all the AnnualRainfall object into
a list.
Validation:
The city Pincode should contain exactly 5 digits. If the city Pincode is valid then
parse the data and calculate the average annual rainfall else throw a user defined
Exception “InvalidCityPincodeException” with a message "Invalid City Pincode".
RainfallReport(utility class)
Component Specification:
RainfallReport(utility class)
Connect to the
database by
invoking the
establishConnecti
on() method of
DBHandler class.
DBHandler(DAO class)
4.0 Submission
4.1 Code submission instructions
1. Do not change the code skeleton given, as your code will be auto
evaluated.
2. You can validate your solution against sample test cases during the
assessment duration.
4. Make sure to submit the solution before the specified time limit. You will
not be allowed to submit the solution once the mentioned time for the
assessment is over.