Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN JAVA !! Project Background: You have been hired at a start-up airline as the sole in-house software developer. Despite a decent safety record

CODE IN JAVA !!

Project Background: You have been hired at a start-up airline as the sole in-house software developer. Despite a decent safety record (99% of flights do not result in a crash), passengers seem hesitant to fly for some reason. Airline management have determined that the most likely explanation is a lack of a rewards program, and you have tasked with the design and implementation of such a program.

Program Specification: The rewards program is based on the miles flown within the span of a year. Miles start to accumulate on January 1, and end on December 31. The following describes the reward tiers, based on miles earned within a single year:

Gold - 25,000 miles. Gold passengers get special perks such as a seat to sit in during the flight.

Platinum - 50,000 miles. Platinum passengers get complementary upgrades to padded seats.

Platinum Pro - 75,000 miles. Platinum Pro is a special sub-tier of Platinum, in which the padded seats include arm rests.

Executive Platinum - 100,000 miles. Executive Platinum passengers enjoy perks such as complementary upgrades from the cargo hold to main cabin.

Super Executive Platinum - 150,000 miles. Super Executive Platinum is a special sub-tier of Executive Platinum, reserved for the most loyal passengers. To save costs, airline management decided to eliminate the position of co-pilot, instead opting to reserve the co-pilot's seat for Super Executive Platinum passengers

For example, if a passenger within the span of 1 year accumulates 32,000 miles, starting January 1 of the following year, that passenger will belong to the Gold tier of the rewards program, and will remain in that tier for one year. A passenger can only belong to one tier during any given year. If that passenger then accumulates only 12,000 miles, the tier for next year will be none, as 12,000 miles is not enough to belong to any tier.

You will need to design and implement the reward tiers listed above. For each tier, you need to represent the miles a passenger needs to belong to the tier, and the perks (as a descriptive string) of belonging to the tier. The rewards program needs to have functionality implemented for querying. Any user of the program should be able to query any tier for its perks.

In addition, a passenger should be able to query the program by member ID for the following:

Miles accumulated in the current year.

Total miles accumulated since joining the rewards program. A passenger is considered a member of the rewards program by default from first flight taken on the airline. Once a member, a passenger remains a member for life.

Join date of the rewards program.

Current reward tier, based on miles accumulated from the previous year.

Given a prior year, the reward tier the passenger belonged to

Queries can be partitioned into two groups: rewards program and rewards member. Queries for perks of a specific tier is part of the rewards program itself, not tied to a specific member. The queries listed above (the bullet point list) are all tied to a specific member.

Incorporate functionality that allows the program to be updated with new passenger information for the following:

When a passenger joins the rewards program, create information related to the new passenger: date joined, rewards member ID, and miles accumulated. As membership is automatic upon first flight, use the miles from that flight to initialize miles accumulated.

When a passenger who is a rewards member flies, update that passenger's miles with the miles and date from the flight.

As the rewards program is new (ie, you are implementing it), assume for testing purposes that the program has been around for many years. To speed up the process of entering passenger information, implement the usage of a file to be used as input with passenger information. The input file will have the following format:

The input file is ordered by date. The first occurrence of a reward member ID corresponds to the first flight of that passenger, and thus should be automatically enrolled in the rewards program using the ID given in the input file.

It may be straightforward to design your program so it performs the following steps in order:

Load input file

Display a list of queries the user can type.

Show a prompt which the user can type queries

For each query input by the user, show the result of the query, and then reload the prompt for the next query

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Applied Corporate Finance

Authors: Aswath Damodaran

4th edition

978-1-118-9185, 9781118918562, 1118808932, 1118918568, 978-1118808931

More Books

Students also viewed these Programming questions

Question

Describe the components of identity.

Answered: 1 week ago

Question

What is the formula to calculate the mth Fibonacci number?

Answered: 1 week ago