Hotel reservation system

Page 1

Hotel Reservation System JAVA ASSIGNMENT HELP

PROGRAMMING ASSIGNMENT HELP | HELP@PROGRAMMINGASSIGNMENTSHELP.NET


LO1: Understand the principles of programming in Java 1.1 Java as a high level language: Java enables programmers to write instructions using English based commands, instead of having to write in numeric codes like in low level languages (i.e. assembly language). It is known as a “high-level” language because it can be read and written easily by humans. These high level instructions are converted or translated into numeric codes that computers can understand and execute. Characteristics of java: 1.

Object Oriented:

a.) Encapsulation: Encapsulation is a mechanism that binds together the code and the data it manipulates, and keeps both safe from outside interference and misuse. To understand it we can take an example of a wrapper that prevents data and code from being arbitrarily accessed by other code defined outside the wrapper. In java a class is used to encapsulate the code and the data. Every single instruction or every method or every data variable should be encapsulated inside any class. b.) Inheritance: it is a process by which one class acquires the properties of another class. A class derived from another class is called a subclass, whereas the class from which a sub class is derived is called a super class In java, subclass inherits the fields and methods of its super class. Keyword “extends” is used to extend the properties of any class. c.) Polymorphism: Polymorphism means many forms. In java, Subclasses of a class can define their own unique behaviors yet share some of the functionality of the parent class. 2.

Distributed Language:

Java is described as a distributed language as it provides high-level support for networking. It provides support for TCP, UDP and basic Socket communication.


A variety of high-level abstractions for network communication and distributed processing are available in java including servlets, jsp, ejb, RMI (Remote Method Invocation), applets and more. 3.

Robustness:

Robust means reliable. Java puts a lot emphasis on early checking for possible errors, as Java compilers are able to detect many problems at compile time only whereas there are encountered at runtime/execution time in other languages. It also has strong memory allocation and automatic garbage collection mechanism and also provides exception handling and type checking as compared to other programming languages. (Head first java, 2015) Read more about Web Application testing JDK development system using an IDE: Advantages:

        

Syntax highlighting. Automatic indenting. Auto code completion. Inbuilt debugger. Access databases. Optimization using profilers built into the IDE. Version control, etc. GUI builder. Compilation and Execution commands.

Disadvantages:

   

Bulky code of GUI. Requires more memory and processing power. Sometimes takes over language control from user. Project compatibility issues with other IDE systems.

1.2 Environmental Flexibility of Programming in Java Platform Independence: Once the java code also known as source code is compiled, it gets converted to native code known as BYTE CODE which is portable & can be easily executed on all operating systems. Byte code generated is basically represented in hexadecimal format. This format is same on every platform be it Solaris work station or Macintosh, windows or Linux. After compilation, the interpreter reads the generated byte code & translates it according to the host machine. . Byte code is interpreted by Java Virtual Machine which is available with all the operating systems we install. So to port Java programs to a new platform all that is required is to port the interpreter and some of the library routines.


Java for Mobile Applications (Java Micro Edition) (Java ME): Java Micro Edition specifically addresses a large range of devices such as pagers, mobile phones, TV settop boxes, microwaves etc. Java ME aims to maintain the qualities including consistency, portability, security and scalability like other Java editions. To support a wide variety of device types, Java ME adopts a modular and scalable architecture. Java ME architecture can be divided into three layers. 1. 2. 3.

Configuration Layer : Provides class libraries for a group of devices Profile Layer: Provides class libraries for particular device category Optional Package Layer: Provides support for additional libraries.

Embedded hardware programming in java (Java Me Embedded): Java Me Embedded is an extension of Java Micro Edition. It enables us to develop highly functional, reliable, portable and secure solutions for embedded devices like ATM machines, in-flight video systems, parking meters etc. (The Complete Reference, 2015)

LO2: Designing Java Solution 2.1: Solution for Given Problem Below are the details on how the solution for given problem will be implemented Possible Inputs:

           

First Name. Last Name. of Adults. of children. Date in. Date out. of Vehicle. Type of Vehicle. Plate no. Type of room. No of rooms. Payment option.

Possible Outputs:

    

Parking charge. Extra bed charge. Credit card charge. Debit card charge. Final cost.

Possible User Interface:


The User interface contains following:-

Labels

o o o o o o o o o o o o o o o o o o o o

For first name. For last name. For address. For contact. For no of adults. For no of children. For date in. For date out. For no of vehicle. For type of vehicle. For model of vehicle. For plate no of vehicle. For type of room. For no of rooms. For Rate per room. For payment option. For charges. For other charges. For discount. Total charge (final cost).

Text filed o For first name (input). o For last name (input). o For address (input). o For contact (input). o For no of adults (input). o For no of children (input). o For date in (input). o For date out (input). o For no of vehicle (input). o For model of vehicle (input). o For plate no of vehicle (input). o For no of rooms (input). o For Rate per room (output). o For charges (output). o For other charges (output). o For discount (input). o Total charge / final cost (output).

Combo Box o For type of vehicle. o For type of room. o For payment option.

Button

o o o o o o

Next on Guest Information form (Redirect to Vehicle Information form). Previous on Vehicle Information form (Redirect to Guest Information form). Next on Vehicle Information form (Redirect to Rate & Payment Information form). Previous on Rate & Payment Information form (Redirect to Vehicle Information form). Calculate on Rate & Payment Information form (calculate final cost). Exit on Rate & Payment Information form (terminate application).


Check box o No vehicle.

Read more about computer network assignment help

2.2: Explanation of Components List of Variable Names and description Variable Name

totalCharge

noOfDays

noOfRooms

roomCharge

Description

·

Variable.

·

Used to Calculate total cost

·

Variable.

·

Used to calculate days of

stay. ·

Output of program.

·

Variable

·

No of rooms are booked.

·

Input from user.

·

Variable

·

Output of the program.

·

Denotes the cost after

Data type

Statement in Java

double

private double totalCharge = 0.0;

Int

private int noOfDays = 1;

int

private int noOfRooms = 0;

float

private float roomCharge = 0;

int

private int extraBedCharge = 0;

int

private int extraCharges = 0;

int

private int noOfAdults = 0;

selecting the type of room.

extraBedCharge

extraCharges

noOfAdults

·

Variable.

·

Extra charge £10 per bed.

·

Output of program.

·

Variable.

·

Total extra charge (parking

charge + extra bed charge). ·

Output of program.

·

Variable.


noOfChildren

discount

modeOfPayment

isVehicel

parkingCharge

·

Input from user.

·

Variable.

Input from user. ·

Variable.

·

Input from user.

·

Variable.

·

Denotes the Payment

option after selecting the mode

private int noOfChildren = 0;

int

private int discount = 0;

int private int modeOfPayment = 0;

of payment. ·

Input from user.

·

Variable.

·

Denotes guest have vehicle

or not. ·

Input from user.

·

Variable.

·

Output of program.

Possible Graphical User Interface: 1.

int

Guest information form

boolean

private boolean isVehicel = false;

int

private int parkingCharge = 0;


2.

Vehicle information form

2.

Rate & Payment Information form


Above is the UI to input information to calculate final cost See more about Web Design Assignment Pseudocode: Steps of pseudo code for the application: Step 1: Guest information form 1. 2.

Start the program. Input first name, last name, address, contact number, no of adults, no of children, date in and date out values.

Step 2: Vehicle information form 1. 2.

Select No vehicle option if guest does not have a vehicle. Otherwise input no of vehicle, type of vehicle, model of vehicle and plate number.

Step 3: Rate & Payment information form 1. 2.

Select type of room, input no of rooms, select payment option and input discount amount. Calculate the cost 1. Calculate the room charge according to the type of room.

   

Deluxe Sea Views Balcony/Terrace: Deluxe rooms are £68 per person per night. Classic Sea Views: Classic Sea Views rooms are £60 per person per night. Family Sea Views : cost of this room is £54.50 per person per night Great Values Sun Pipes : cost of this room is £20.50 per person per night


1.

Calculate the parking charge.

Parking is free if staying more than three nights otherwise £5 per day.

1.

Calculate the extra bed charge.

In each room maximum 3 adults and 3 children can stay but facility of extra bed is provided @£10 per night.

3.

If cost >£200 then mode of payment can be debit and credit only 1. If debit card is selected then final cost = cost +£50. 2. Else if credit card is selected then final cost = cost + 2% of cost. 3. Else final cost = cost. End of the program.

4.

Read our experts Advice: Website Designing Assignment

Flow-Charts Below is the flow chart describing the process of the application



LO3: Implementing Java Solution 3.1 Java Programming Solution Below is the code snippet of the solution implemented for the problem given in assignment.


3.2 Relationship between Objects Below is the class diagram to show the relationship of objects that are used in this solution


3.3 Objects behaviors using control structures to meet the design algorithms Behaviors of class Home.



LO3: Exception Handling and Implementing GUI Solution 3.4 Screen shots of exceptions handled and reported in Netbeans IDE. Validation: if you press next button without entering valid values of Guest information it shows a message and don’t move to the Vehicle information form.


Validation: if you press next button in Vehicle information form without entering valid values of Vehicle information it shows a message and don’t move to the Rate & Payment information form.


Validation: if you press next button in Rate & Payment information form without entering valid values of payment it shows a message and don’t move to the Rate & Payment information form.

3.5 Screen shots of code and GUI application at different points Here code is written in Netbeans IDE.


After asking for rooms this panel shows up in which user will enter the guest information and navigate to the vehicle information form.

After pressing the next button if all inputs are valid then vehicle information form will display.


After pressing the next button if all inputs are valid then vehicle information form will display.

After pressing the next button if all inputs are valid then Rate & payment form will display. For final calculation user should input valid data and then click on calculation button.


This Screen shows the total charge (final cost) and also gives user mode of payment options if total cost is greater than ÂŁ200 else the mode of payment may be cash. Below is selected Debit Card and its total charge according to it.[ Get Heartbleed Vulnerability Bug Report Assignment Help.] And here the second mode of payment is selected i.e. Credit Card and the total charge according to it.


LO4:Test and Document java solutions 4.1 Review and test Java programming solutions This java programming solution has been tested and reviewed to be correct at every point of testing. According to all the test cases the given program is found correct.

4.2 Analysis of actual test results against expected results First Case:

When one or more fields are empty or data is invalid then if next button is pressed then the particular message is shown as shown below Second Case:


When charge is more than £200 and payment option is Cash then it will show error message.

4.3 Feedback on a developed java recommendations for improvements

program

solutions

and

There is no negative feedback for the proposed programming in java solution. And hence no recommendations for improvements have been done in the java solution.

4.4 User documentation for the developed java solution The developed application provides functionality to calculate total charge. Following are the steps of using this application: 1. 2. 3. 4. 5. 6. 7. 8. 9.

Start the application Specify guest information. Click on “Next” button. Specify vehicle information or select no vehicle option. Click on “Next” button or want to edit guest information then click on pervious button. Select payment and room options and enter discount value. Click on “Calculate” button to calculate final cost (total charge). Application will automatically display charge, other charges, and total charge (final cost). It user wants to give discount then input discount amount in discount field and click on “Calculate” button. 10. Click on “Previous” to edit data or Click on “Exit” to Close Application.

[Explore Web Designing using JSP Architecture and get to know about concepts of web designing.]

4.5 Technical documentation for the support and maintenance of java solution


The whole functionality of the application is defined in the class “Home” and “Validator”. Home class holds all information about the working parameters (Like name, address, no of guest, vehicle etc.) and provides all methods to calculate final cost of the work. Validator class provides few static methods to validate data. Home class provides following methods: setDisableComponents() : method used to disable components of Rate & Payment Information form validateFirstForm() : method used to check all values of Guest information form. validateSecondForm() : method used to check all values of Vehicle information form. validateFinalForm() : method used to check all values of Rate and Payment information form. getExtraBedCharges() : method calculate and returns extra charges of extra beds. getParkingCharges() : method returns value of parking charges. getExtraCharges() : method return total extra charges (extraBadCharges + parkingCharge). isValidNoOfRooms() : method used to check is input no of rooms is valid or not. getModeOfPayment() : method used to get value of payment option like CASH, CREDIT CARD, DEBIT CARD. getRoomCharge() : method used to get room charge per room. getNoOfChildrens() : returns no of children. getNoOfAdults() : return no of adults. getDays() : return total days of stay. getDiscount() : returns discount value. getNoOfRooms() : return total no of room hired. Home class provides following methods. isEmpty(String) : This method is used to check empty values return true if value is empty or null false otherwise. validateDate(String) : This method is used to validate date. isNumber(String) : Method find out whether the input string is number or not. isFilled(String) : method find out whether the given string is empty or not. isValidDiscount(String) : Method find out whether the input string(Discount) is less than total charge or not. isCorrectDateOutValue(String, String) : Method compares both values od date (Date in and Date out). Please click below for API documentation for Application.


Read more about Computer Programming Assignment Help

Bibliography    

Flow Chart. (2015, February 28). Retrieved from creately.com: http://creately.com/diagramtype/article/introduction-flowchart-symbols> Head first java. (2015, february 28). Retrieved from Safari books: https://www.safaribooksonline.com/library/view/head-first-java/ The Complete Reference. (2015, february 28). Retrieved from Safari books: https://www.safaribooksonline.com/library/view/java-thecomplete/9780071808552/cover.html UML tutorial. (2015, february 28). Retrieved from Tutorials point: http://www.tutorialspoint.com/uml/

Programming Assignments Help is the best assignment help provider in the United Kingdom. Our online assignment writing help UK is especially dedicated for the students studying in all UK colleges and universities. Submit assignment to get the best quality assignment help.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.