Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment

The Problem:

A common task in computing is to take data and apply changes (called transactions) to the data, then saving the updated data. This is the type of program you will write.

You will read a file of flight reservation data to be loaded into an array with a max size of 20. A second file will hold the transactions that will be applied to the data that has been stored in the array. At the end of the program, the updated data in the array will be written to a third file.

Flight class

This class will hold the information about a flight. It is responsible for the following data: flight number,flight date, departure airport, arrival airport, departure time, arrival time, and seat assignment. The date will be in the form mm/dd/yyyy. The time will be in the form hh:mm PM. This class should include a default constructor and another constructor that will receive data for all of the instance variables. Also includetoString and equals methods. The toString needs to format the data in the form that is needed for output written to the screen in an itinerary. Two Flight classes are considered equal when they have the same flightNumber and flightDate.

Reservation class

This class holds all of the information about a reservation for one person. It will include the passenger's name (one variable to hold first and last names), reservation number, departure flight and return flight (the flights are objects of the Flight class). Constructors should include a default constructor and another one that accepts values for all of the instance variables. Also include toString and equals methods. ThetoString needs to format the data in the format of output written to the screen in an itinerary. Reservations are considered to be equal when they have the same reservation number.

Airline class

This class is responsible for holding the array of reservations and all of the methods to process the transactions. Transactions are represented in the file with a numeric code as follows:

Code Transaction

1 Add a reservation - all data will be the same format as the reservations that are loaded into the array at the beginning of the program.

2 Print the itinerary of one passenger - Printed to the screen

3 Print the itineraries of all of the reservations - Printed to the screen

4 Write list to file - Writes all of the updated reservations in the list to a file

AirlineInput class

There are two input files. The first file, AirlineData.txt, holds all of the existing reservations. This should be read at the beginning of the program and stored in an array. The second file,Transactions.txt, has the transaction codes and data that is associated with each code.

AirlineData.txt format
















Transactions.txt format.

Note: each type of transaction requires different input. The code will be followed by the data required for that code. There will be a code and data in one of the following formats.

Transaction code 1



< reservation number>













Transaction code 2


Transaction code 3

Transaction code 4

AirlineOutput class

This class will be responsible for:

• Code 2 - Displaying the itinerary for one passenger

o Sample output:

Passenger Name: Carl Foreman

Reservation Number: 1234

DepartureFlight:

Flight Number: UA1235
Flight Date: June 23, 2014
Departure Airport: null

Arrival Airport: null

Departure Time: 4:00 PM
Arrival Time: 7:15 PM
Seat: 23A

Return Flight:
Flight Number: UA673
Flight Date: July 12, 2014
Departure Airport: null
Arrival Airport: null
Departure Time: 10:00 AM
Arrival Time: 11:25 AM

Seat: 8A

o Note that the date has been changed from the form 04/16/2014 to the form April 16, 2014

• Code 3 - Displaying the itineraries for all reservations

o This displays the itinerary for each person in the same format as above.
o Leave a blank line between each itinerary.

• Code 4 - Writing the contents of the array to the file

o This should be in the same format as the input file AirlineData.txt

- The data can be left in the format used to display to the screen.

o Name this file xxx-UpdatedData.txt where the xxx represents your initials.

Design: Create an electronic document in .doc, .docx, or .pdf format containing the pseudocode algorithm for the driver and the class diagrams for all other classes.

JavaDoc: Generate the JavaDocs for the project.

Java, Programming

  • Category:- Java
  • Reference No.:- M92402559
  • Price:- $75

Priced at Now at $75, Verified Solution

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As