You are on page 1of 10

EEP 773

Telecom Software Lab

Assignment Number 6
6 September 2014

Shobhit Shrivastava
2014JTM2267

Indian Institute of Technology, Delhi

Contents
1 Problem Statement

2 Assumptions

3 Logic Explanation
3.1 An Overview : Dierent Classes Used . . .
3.2 Creating a Customer Database through File
3.2.1 Adding Customer . . . . . . . . . . .
3.3 Instant View and Modifying in Database . .
3.4 Generating Bills . . . . . . . . . . . . . . .
4 Screenshots
4.1 Screenshot
4.2 Screenshot
4.3 Screenshot
4.4 Screenshot

1
2
3
4

. . . . . .
Handling
. . . . . .
. . . . . .
. . . . . .

Showing Main Menu . . . . . . . . .


Adding Customer . . . . . . . . . .
Instant View and Modifying Service
Generating Bills . . . . . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

3
3
4
4
4
4

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

5
5
5
6
6

List of Figures
1
2
3
4
5

Block Diagram Depicting Program Flow Logic


Showing the main menu after program run . .
Showing add customer function working . . . .
Showing Instant View and Modify service . . .
Showing bill generation . . . . . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

3
5
5
6
6

Problem Statement

Generate a Billing Model for Elephen Cloud Services , a cloud services oering body in which customer
takes the available services and an appropriate bill as per the time of service usage should get generated.
The services to be included are maily categorized in three parts,viz.
Infrastructure as a Service (Iaas)
IaaS is the most basic cloud service model under which virtual machines, raw block storage, firewalls, load balancers,and networking services are provided.
Platform as a Service (PaaS)
PaaS includes software frameworks and the necessary hardware in which to develop and deliver
Software as a Service (SaaS).
Software as a Service (SaaS)
Within the SaaS model, cloud providers install and operate application softwares in the cloud,which
users access using cloud clients on the computers, mobile devices, browsers, etc.
The system has to be designed in Java. And no pre-skeleton code or outline is there.
Though following features must be included :
1. Adding a new customer and the service requests
2. Editing (addition/deletion of services) previous subscription
3. Generating bills for customers

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

Assumptions

I have taken following assumptions while preparing solution to the given problem statement :
1. Customer information for adding a new customer is available in a file in pre-fixed format which we
have got from the customer itself through e-mail or some resource.
2. The base price for the services are fixed. Though depending uppon the number of services and
time the customer has used them may vary dynamically.
3. Modification in an information is done through console by properly displayed review.
4. Each customer has to compulsorily enter their unique mobile number during registration as it will
serve the purpose of a SSN key. Though the mobile number can be modified.
5. All the customer files which the user will get, he/she will keep them in a single folder so that typing
only the name of the file enables retrieval and hectic path specifying burden reduces.
6. Services will not be provided if input is out of bounds and other than the format specified, though
the success message comes out. The files generated will remain blank and form a junk.

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

Logic Explanation

I have divided the complete problem statement into various modules and tried to understand, code and
analyze these; collaborating to form the answer to the given problem statement. All these modules and
program flow is well depicted in the block diagram below :

Figure 1: Block Diagram Depicting Program Flow Logic


All the modules form a dierent file clubbed together using java utility. The complete logic and module
description are as below :

3.1

An Overview : Dierent Classes Used

Four classes and their functional overviw includes :


Run
In this class main menu and main() function is defined.
Customer
This is the class with majority of working methods including addc ustomer() , modif y() featuring
reading through file and writing into the file streams.
Services
This class include base rates for all the services the service provider oers. Random number
generation and returning the rates for eacch service feature is there.
Billing
In this class, bills for each customer is being generated and the same bill is written into a file to
be used for notifying customer and printing etc.

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

3.2

Creating a Customer Database through File Handling

A public class Run is created in a seperate Run.java file containing the main() function. This class
contains the main menu. As it is assumed that customer information is already there in a specified
format in a file so now the function reduces to reading those files and creating a database to store all the
information.
3.2.1

Adding Customer

When add customer() function is called using the main menu the program control moves to that function
in the Customer class. Filename in with the user information is typed in console and the complete file is
read line by line using the predefined readLine() function and gets stored in an string array data array[].
Using FileInputStream, BueredReader and BueredWriter pre-defined java classes this array is made
to be written into a file namedDatabase.txt.
Later when another customer file is selected to add customer the same array is used and Database gets
appended.
In this way a new customer account is created and database gets updated.

3.3

Instant View and Modifying in Database

When the function modif y() is called in main(), program control moves to that method created within
the customer class. As pre-assumed that unique mobile number serves as the identity or key in this
program on entering the mobile number, it will match it with every string written in the updated file
Database.txt using an array named search array[]. If found, customer details are displayed on the
console line by line prompting
Do you really want to modif y it ? (y/n)
Getting this statement correct it will ask for the new information, which is to be entered is the specified
format only. And the array then gets updated there only and using FileInputStream and BueredWriter
classes is re-written into the Database.
In this way the user can modify the customer information and add services which is also a part of
modifying it.
In case you wish to delete it, set all fields as 0.

3.4

Generating Bills

When the function modif y() is called in main(), program control moves to that method created within
the customer class. As pre-assumed that unique mobile number serves as the identity or key in this
program on entering the mobile number, it will match it with every string written in the updated file
Database.txt using an array named search array[] and creates a local mapping for that particular customer in an array named Cust local array[].
As the line by line searh goes on an object of class Services calling a method get Rates() which
returns the service rate as per the randomly generated time value.
Pre-defined class Random is accessed to generate the random numbers which on multiplication with
base rates generate service rates. And also a function print bill() invokes.
This print bill() function using FileInputStream and BueredWriter classes, the complete billing
information is written into a file with user specified name.

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

4
4.1

Screenshots
Screenshot 1 - Showing Main Menu

Figure 2: Showing the main menu after program run

4.2

Screenshot 2 - Adding Customer

Figure 3: Showing add customer function working

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

4.3

Screenshot 3 - Instant View and Modifying Service

Figure 4: Showing Instant View and Modify service

4.4

Screenshot 4 - Generating Bills

Figure 5: Showing bill generation

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

References
[1] http://www.tutorialspoint.com/java/
[2] http://www.learnjavaonline.org/
[3] http://tex.stackexchange.com/questions
[4] https://www.sharelatex.com/learn

EEP Telecom Software Lab: Assignment 6 Shobhit Shrivastava 6 September 2014

You might also like