Java Project Assignment Help

This solution is about Java Project Assignment Help

Introduction

This assignment has been assigned to understand the object-oriented concepts and implement a flight booking system using java programming tool. The NetBeans editor is used to code the program. The developed system has successfully fulfilled the system specifications.

Explain the key oops concepts

JAVA programming language was created by James Gosling at Sun Microsystems. Sun Microsystems discharged the first open execution as Java 1.0 in 1995. We anticipated that would use C++, nonetheless, we encountered different issues. At first, these were just compiler advancement issues, yet as time passed we encountered a game plan of issues that were best seen by changing the language. The essential reason the Java language was made was to have the ability to control smaller scale things. This joins things like sharp cards, toasters, coolers, et cetera. After it was created, it was found to enable component content on site pages. Highlights of Java programming language like as Object-Oriented, Robust, stage free, Secure, Portable, High Performance, Distributed, and Dynamic and so forth.

Three main features of Java programming language are:

  1. Java is easy to learn and simple programming language which allows developers to learn it easily. It is easy to learn for the people who are not from the programming background.
  2. Java is portable (also known as platform independence) i.e. java program can be executed on any machine which is having required java runtime environment available. Programs which are developed on windows can be executed on Linux or UNIX environment without making any changes in the code.
  3. Java program can be created in such a manner that they support multiple tasks at a time. This feature is known as multithreaded programming.

Apart from the features mentioned above there are lots of other features available in Java are listed below:

  • Java is object-oriented
  • Java is robust
  • Java is secure
  • Provides high performance

Read more about:  Thread Life Cycle Java Assignment Help

Classes and Objects

A class provides the definition for an object or we can say a class is a collection of entities that have some common characteristics.

An object is an instance of the class.

class Person

{

            private String firstName;

            private String lastName;

            public Person(){

                        this.firstName = “Unkonwn”;

                        this.lastName = “Unkonwn”;

            }

            public Person(String firstName, String lastName){

                        this.firstName = firstName;

                        this.lastName = lastName;

            }

            public Person(Person p){

                        this.firstName = p.firstName;

                        this.lastName = p.lastName;

            }

            public void set(String firstName, String lastName){

                        this.firstName = firstName;

                        this.lastName = lastName;

            }

            public void show(){

                        System.out.print(firstName+” “+lastName);

            }

}

The above designed person class provides definition for its objects that they all will have 3 instance variable and can perform set() and show() operations.

Person p1 = new Person();

Person p2 = new Person(“Raman”,”Sharma”);

Here p1 and p2 are reference variables that refer to two objects of Person Class.

Read more about Advance java programming assignment 

Inheritance: When one class is derived from another class it is known as inheritance. The derived class has features of base class plus its own additional functionality.

Private members of a class are never inherited.

class Roll{

            protected int rollNo;

            public Roll(){

                        rollNo=0;

            }

            public Roll(int rn){

                        rollNo=rn;

            }

            public Roll(Roll r){

                        rollNo = r.rollNo;

            }

            public void set(int rollNo){

                        this.rollNo = rollNo;

            }

            public void show(){

                        System.out.print(“Roll No :: “+rollNo);

            }

}

class Person extends Roll{

            protected String fname;

            protected String lname;

            public Person(){

                        this.fname = “Unknown”;

                        this.lname = “Unknown”;

            }

            public Person(int rn,String fn,String ln){

                        super(rn);

                        this.fname = fn;

                        this.lname = ln;

            }

            public Person(Person p){

                        super(p);

                        this.fname = p.fname;

                        this.lname = p.lname;

            }

            public void set(int rn,String fn,String ln){

                        this.rollNo = rn;

                        this.fname = fn;

                        this.lname = ln;

            }

            public void show(){

                        System.out.print(“Roll No :: ” + rollNo +” Name :: ” + fname +” ” +lname);

            }

}

class Student extends Person{

            protected int marks;

            public Student(){

                        marks=0;

            }

            public Student(int rn,String fn,String ln, int mks){

                        super(rn,fn,ln);

                        marks=mks;

            }

            public Student(Student s){

                        super(s);

                        marks=s.marks;

            }

            public void set(int rn,String fn,String ln, int mks){

                        rollNo = rn;

                        fname = fn;

                        lname = ln;

                        marks=mks;

            }

            public void show(){

            System.out.print(“Roll No :: “+rollNo+” Name :: “+fname+” “+lname+” Marks :: “+marks);

            }

}

class Main{

            public static void main(String args[]){

            Student s1 = new Student();

            Student s2 = new Student(1,”Rahul”,”Singh”,92);

            Student s3 = new Student(s2);

            System.out.print(“First Student \n”);

            s1.show();

            System.out.print(“\nSecond Student\n”);

            s2.show();

            System.out.print(“\nThird Student\n”);

            s3.show();

}

}

Polymorphism

If same message is passed to different objects, each object responds differently depending upon its class, this is called polymorphism.

//Polymorphism ( One name many form )

class Animal{

            public void speak()                  {

                                    System.out.println(“Animal speaks”);

                        }

                        public void move()                  {

                                    System.out.println(“Animal moves”);

                        }

}

class Dog extends Animal{

            public void speak()                  {

                                    System.out.println(“Dog barks”);

                        }

            public void move()                 {

                                    System.out.println(“Dog jumps”);

                        }

}

class Lion extends Animal{

            public void speak()                  {

                                    System.out.println(“Lion roars”);

                        }

                        public void move()                  {

                                    System.out.println(“Lion walks”);

                        }

}

class MainClass{

            public static void main(String args[]){

                        Dog d = new Dog();

                        Lion l = new Lion();

                        Animal ap;

                        ap = d;

                        ap.speak();      //Dog barks

                        ap.move();       //Dog jumps

                        ap = l;

                        ap.speak();      //Lion roars

                        ap.move();       //Lion walks

            }

}

Design a console based software for an airline booking system

 

The flight booking system should do the following:

I have used net beans which is a very useful IDE the help to detects errors in my code at a real-time and shows warnings too. I have used it to generate getter setter methods for my classes.

In order to achieve the specifications, I have planned the solution by producing a range of UML diagrams and provide justification to my chosen designs

 

Java Project Assignment Help, Java Assignment Help, Java Programming Assignment Help, Java Programming Assignments Help, Professional Java Assignment, top grade assignment, Top Grade Assignment Help

      Figure 1 UML diagram

Read more about: Web Technology Assignment Help

Customer class

This class represents a customer or the person that books the ticket. It is much easy to handle a cluster as an object rather some individual class so I have implemented this class which contains instance variable that stores information about the customer.

package ticketmanagment;

import java.io.Console;

public class Customer {

    private int CustomerId;

    private String Email;

    private String customerName;

    private String Phone;

    private String City;

    public int getCustomerId() {

        return CustomerId;

    }

    public void setCustomerId(int CustomerId) {

        this.CustomerId = CustomerId;

    }

    public String getCustomerName() {

        return customerName;

    }

    public void setCustomerName(String customerName) {

        this.customerName = customerName;

    }

    public String getPhone() {

        return Phone;

    }

    public void setPhone(String Phone) {

        this.Phone = Phone;

    }

    public String getEmail() {

        return Email;

    }

    public void setEmail(String Email) {

        this.Email = Email;

    }

    public String getCity() {

        return City;

    }

    public void setCity(String City) {

        this.City = City;

    }

    @Override

    public String toString() {

        return “Customer{” + “CustomerId=” + CustomerId + “, Email=” + Email + “, customerName=” + customerName + “, Phone=” + Phone + “, City=” + City + ‘}’;

    }

    public void read(){

        Console con = System.console();

        System.out.print(“Enter Customer Name “);

        customerName = con.readLine();

        System.out.print(“Enter Customer Phone “);

        Phone = con.readLine();

        System.out.print(“Enter Customer Email “);

        Email = con.readLine();

        System.out.print(“Enter Customer City “);

        City = con.readLine();

    }

}

Flight class

The flight class is used to represent a flight. It contains instance variables that will hold information about the flight. It is very much easier to handle flight information as an object rather that some individual objects

package ticketmanagment;

import java.io.Console;

import java.util.logging.Logger;

import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec;

public class Flight {

    private int FlightId;

    private String FlightName;

    private String Duration;

    private String ArrivalTime;

    private String DepTime;

    private String ArrivalAirport;

    private String DepAirport;

    private int TotalNumberOfSeats;

    private int TicketPrice;

    private int AvailableSeats;

   public int getAvailableSeats() {

        return AvailableSeats;

    }

    public int getTotalNumberOfSeats() {

        return TotalNumberOfSeats;

    }

    public Flight(){

    }

    public Flight(int FlightId, String FlightName, String Duration, String ArrivalTime, String DepTime, String ArrivalAirport, String DepAirport, int TotalNumberOfSeats, int TicketPrice, int AvailableSeats) {

        this.FlightId = FlightId;

        this.FlightName = FlightName;

        this.Duration = Duration;

        this.ArrivalTime = ArrivalTime;

        this.DepTime = DepTime;

        this.ArrivalAirport = ArrivalAirport;

        this.DepAirport = DepAirport;

        this.TotalNumberOfSeats = TotalNumberOfSeats;

        this.TicketPrice = TicketPrice;

        this.AvailableSeats = AvailableSeats;

    }

    public int getFlightId() {

        return FlightId;

    }

    public void setFlightId(int FlightId) {

        this.FlightId = FlightId;

    }

    public void setTotalNumberOfSeats(int TotalNumberOfSeats) {

        this.TotalNumberOfSeats = TotalNumberOfSeats;

    }

    public int getTicketPrice() {

        return TicketPrice;

    }

    public void setTicketPrice(int TicketPrice) {

        this.TicketPrice = TicketPrice;

    }

    @Override

    public String toString() {

        return “Flight Id = ” + FlightId + “\nDetails\nFlightName=” + FlightName + “, Duration=” + Duration + “, ArrivalTime=” + ArrivalTime + “, DepTime=” + DepTime + “, ArrivalAirport=” + ArrivalAirport + “, DepAirport=” + DepAirport + “, TotalNumberOfSeats=” + TotalNumberOfSeats + “, TicketPrice=” + TicketPrice + “\n”;

    }

    public String getFlightName() {

        return FlightName;

    }

    public void setFlightName(String FlightName) {

        this.FlightName = FlightName;

    }

    public String getDuration() {

        return Duration;

    }

    public void setDuration(String Duration) {

        this.Duration = Duration;

    }

    public String getArrivalTime() {

        return ArrivalTime;

    }

    public void setArrivalTime(String ArrivalTime) {

        this.ArrivalTime = ArrivalTime;

    }

    public String getDepTime() {

        return DepTime;

    }

    public void setDepTime(String DepTime) {

        this.DepTime = DepTime;

    }

    public String getArrivalAirport() {

        return ArrivalAirport;

    }

    public void setArrivalAirport(String ArrivalAirport) {

        this.ArrivalAirport = ArrivalAirport;

    }

    public String getDepAirport() {

        return DepAirport;

    }

    public void setDepAirport(String DepAirport) {

        this.DepAirport = DepAirport;

    }

    public void read() throws Exception{

        try{

            Console con = System.console();

            System.out.print(“Enter Flight Name “);

            FlightName = con.readLine();

            System.out.print(“Enter Duration “);

            Duration = con.readLine();

            System.out.print(“Enter Arrival Time “);

            ArrivalTime = con.readLine();

            System.out.print(“Enter Dep. Time “);

            DepTime = con.readLine();

            System.out.print(“Enter Arrival Airport “);

            ArrivalAirport = con.readLine();

            System.out.print(“Enter Dep. Airport “);

            DepAirport = con.readLine();

            System.out.print(“Enter Total Number Of Seats. “);

            TotalNumberOfSeats = Integer.parseInt(con.readLine());

            if(TotalNumberOfSeats <= 0 || TotalNumberOfSeats > 30){

                System.out.println(“Total number of seats must be >0 and <=30”);

                throw new Exception();

            }

            System.out.print(“Enter Ticket Price “);

            TicketPrice = Integer.parseInt(con.readLine());

            if(TicketPrice<150){

                System.out.println(“Ticket Price Must be >=150”);

                throw new Exception();

            }

        }

        catch(Exception e){

            throw e;

        }

    }

}

Read more about: Professional Java Assignment Help

Demonstrate how you overcame problems with the design critically reflecting on your solution / implemented algorithms and provide adequate reasons

S. No. Test case Expected result Actual Result
1 Flight Creation The user must be able to create a new flight Yes user is able to create a flight
2 Book a ticket The user must be able to book a ticket Yes the user is able to book a ticket.
3 Cancel Ticket. The user must be able to cancel a ticket Yes the user is able to cancel a ticket.

You will implement your solution using industrial strength IDE and tools.

[AC 4.4] Your system will have a help tool to assist users on screen. Screenshots of the latter to show evidence operation of the on-screen help.

The following screen shows the software in action:

Java Project Assignment Help, Java Assignment Help, Java Programming Assignment Help, Java Programming Assignments Help, Professional Java Assignment, top grade assignment, Top Grade Assignment Help

Figure 2 home screen

 

Java Project Assignment Help, Java Assignment Help, Java Programming Assignment Help, Java Programming Assignments Help, Professional Java Assignment, top grade assignment, Top Grade Assignment Help

Figure 3 entering the choice

Java Project Assignment Help, Java Assignment Help, Java Programming Assignment Help, Java Programming Assignments Help, Professional Java Assignment, top grade assignment, Top Grade Assignment Help

Figure 4 showing the ticket booked output

 Read more about: Database Design Concept Assignment

Conclusion

The report is generated in order to successfully implement the specified program and improve the learner’s skills. This assignment provides a good platform to understand the fundamental concepts of Java and apply his knowledge and skills through implementation.

References

JavaWorld.(2016). Welcome to JavaWorld.com. [online] Available at: http://www.javaworld.com/ [Accessed 4 May 2016].

Studytonight.com, (2016).Features of Java | Core Java Tutorial | Study tonight. [online] Available at: http://www.studytonight.com/java/features-of-java.php [Accessed 20 Jan. 2016].

www.javatpoint.com, (2015). JVM | Java Virtual Machine – Javatpoint. [online] Available at: http://www.javatpoint.com/internal-details-of-jvm [Accessed 19 Dec. 2015].

Javaperformancetuning.com, (2016).Java performance tuning tips. [online] Available at: http://www.javaperformancetuning.com/tips/rawtips.shtml [Accessed 20 Jan. 2016].

Docs.oracle.com. (2016).JavaServer Pages Technology – The Java EE 5 Tutorial. [online] Available at: http://docs.oracle.com/javaee/5/tutorial/doc/bnagx.html [Accessed 3 May 2016].

Top grade assignment help is the best assignment help provider in the Australia. Our online Technical Assignment Help is specially dedicated for the students studying in all UK colleges and universities. Submit assignment to get the best quality assignment help.

Technical Assignment Help,top grade assignment help, PHP Assignment help, Top Grade Assignment, Assignment help australia, online assignment help, java assignment help

 

 

About the Author

Alice