1. Homepage
  2. Programming
  3. Programming 2 EXERCISE 3 – Java Basics: Flights-of-Fancy

Programming 2 EXERCISE 3 – Java Basics: Flights-of-Fancy

Engage in a Conversation
Programming 2Flights-of-FancyJava

PROGRAMMING 2 – SPRING 2023 EXERCISE 3 – JAVA BASICS CourseNana.COM

In this exercise, you will develop a program for an airline called Flights-of-Fancy. You will be developing a simple flight-booking system, which helps passengers book flight tickets. CourseNana.COM

THIS EXERCISE WILL BE GRADED (MAX: 10 points) SUBMISSION DEADLINE: MARCH 9, 2023, 23:00 CourseNana.COM

Task 1. Install Maven CourseNana.COM

Follow the instructions available on the following page to install maven: CourseNana.COM

https://www.baeldung.com/install-maven-on-windows-linux-mac CourseNana.COM

As mentioned briefly in one of the lectures, maven is a build tool that helps you manage the different parts of your project and helps you meet the different library and package requirements necessary for successful execution of your program. One of that requirements is Java unit testing using JUnit. CourseNana.COM

Task 2. Accept the GitHub Classroom assignment CourseNana.COM

GitHub Classroom Link: https://classroom.github.com/a/DGkFbZg9 CourseNana.COM


Go to the above link. It will take you to the following page, where you have to click CourseNana.COM


on “Accept this assignment”: CourseNana.COM


Then you will be taken to the following page: CourseNana.COM

PROGRAMMING 2 – SPRING 2023 CourseNana.COM


If the above page does not change soon, simply refresh the page, and then you will be shown the following page. Click on the GH link to your repository: CourseNana.COM


This is the repository that has the exercise 1 assignment. Clone this repository in your local system following the same process as you did in your previous exercises. CourseNana.COM


Once cloned, start working on your exercise. CourseNana.COM


The only files you will work on are located in src -> main folder. Just follow the instructions given below and write a complete and correctly working program. CourseNana.COM


Task 3. Flight booking system for Flights-of-Fancy CourseNana.COM


Create a flight booking program that accepts the passenger’s details, the trip requirements (absolute basics), and then finally display the details of the passenger, along with the information about the trip. You DO NOT have to worry about implementing the SOLID principles for this exercise. That will be evaluated in the future exercises.  CourseNana.COM


The following requirements are MANDATORY: CourseNana.COM

Your program must have these attributes stored in the variables listed below:
o flightCompany – This variable will store the constant Flights-of-Fancy. This CourseNana.COM

must NOT be entered by the Passenger.
o flightID – Every flight has an ID, e.g., FOF0345IN. This information is not CourseNana.COM

submitted by the passenger. It must be generated by the program CourseNana.COM

PROGRAMMING 2 – SPRING 2023 CourseNana.COM

automatically after a booking is completed. This must NOT be entered by the Passenger. Consider using String concatenation to create value for this variable. CourseNana.COM

o passengerFullName – Passenger’s full name. DO NOT split it into first-name and last-name. The entire name should be stored in this one variable. CourseNana.COM

o tripSource–ThecityfromwherethePassengerwillstartthetrip.Fornow,this will be a constant value of NANJING. This must NOT be entered by the Passenger. CourseNana.COM

o sourceAirport – The airport from where the Passenger will take the departing flight. For now, this will be a constant value of NANJING LUKOU INTERNATIONAL AIRPORT. This must NOT be entered by the Passenger. CourseNana.COM

o tripDestination–ThedestinationcitywherethePassengerwillland.Fornow, this will be a constant value of OULU. This must NOT be entered by the Passenger. CourseNana.COM

o destinationAirport - The airport where the Passenger will land. For now, this will be a constant value of OULU AIRPORT. This must NOT be entered by the Passenger. CourseNana.COM

o departureDate – The date when the Passenger will start the trip. It should be in the format YYYY-MM-DD, for e.g., 2023-03-07. This variable cannot be a String. However, you can convert a String to date. You need to figure out how. CourseNana.COM

o returnDate – We are assuming that this will be a return trip. So, this variable will store the date when the Passenger returns from the trip. It should be in the format YYYY-MM-DD, for e.g., 2023-03-07. This variable cannot be a String. However, you can convert a String to date. You need to figure out how. CourseNana.COM

o childPassengers – No. of children the Passenger will be taking on the trip. Can accept ‘0’ as a value. CourseNana.COM

o adultPassengers – No. of adult passengers for the trip.
o totalPassengers – Total number of passengers for the trip. Simply an addition CourseNana.COM

of number of children passengers and adult passengers.
o departingTicketPrice – The price of the ticket for the departing journey. You CourseNana.COM

can come up with whatever logic you want. This must NOT be entered by the CourseNana.COM

Passenger.
o returnTicketPrice–Thepriceoftheticketforthereturnjourney.Youcancome CourseNana.COM

up with whatever logic you want. This must NOT be entered by the Passenger. o totalTicketPrice–Additionofthedepartingtrippriceandreturntripprice.This CourseNana.COM

must NOT be entered by the Passenger.
o ticketNumber – A number unique for every new trip. This must NOT be CourseNana.COM

entered by the Passenger. Consider using String concatenation to create a value for this variable. CourseNana.COM

Remember, the variable names should be exactly as stated above. If there’s any difference, like a spelling mistake, then the tests will fail, which means that you will lose points. CourseNana.COM

Therefore, DOUBLE CHECK your variable names. You can have more variables than what is listed above, if you want, and you can name it whatever you like. However, CourseNana.COM

PROGRAMMING 2 – SPRING 2023
the variable names we have listed above are MANDATORY and should be named CourseNana.COM

exactly the way they are.
IMPORTANT: None of the variables listed above should be directly accessible by an CourseNana.COM

outside class. CourseNana.COM

You program MUST have the following behaviour implemented using appropriate methods: CourseNana.COM

o At least one Constructor that takes in as parameters EVERY INPUT that is accepted from the user. CourseNana.COM

o The necessary Getters and Setters. These should be named as the convention dictates. For instance, a Getter for ticketNumber MUST be called getTicketNumber(). Similarly, a Setter for the same variable MUST be called setTicketNumber(). CourseNana.COM

After accepting inputs from the Passenger and doing the necessary calculation, your program must display a confirmation message. It should be EXACTLY in the following format. Ignore the font colour. It’s only for highlighting purposes here. CourseNana.COM

Dear passengerFullName. Thank you for booking your flight with FLIGHT_COMPANY. Following are the details of your booking and the trip:
Ticket Number:
ticketNumber
From TRIP_SOURCE to TRIP_DESTINATION CourseNana.COM

Date of departure: departingDate
Date of return: returningDate
Total passengers: totalPassengers
Total ticket price in Euros: totalTicketPrice CourseNana.COM

In the above message, all the variables will display their relevant values that come from the inputs from the Passenger and your various calculation. CourseNana.COM

Be VERY CAREFUL in creating the above message. It should be EXACTLY how it is shown. Even a change in space between two words can fail the test. CourseNana.COM

Task 4. Commit and check the test results CourseNana.COM

Once you have finished writing your program and have confirmed that everything works exactly as instructed above, then you can commit your changes. The process is similar to how you have done in the previous exercises. CourseNana.COM

Remember to write “SUBMITTED” (without the quotes) as your commit message. This means that you have OFFICIALLY submitted your exercise assignment. CourseNana.COM

Go to the current repository in GH, and click on “Actions” CourseNana.COM

PROGRAMMING 2 – SPRING 2023 CourseNana.COM


Then you will see the following page. There, click on the topmost commit. In your case, it should just read “SUBMITTED”. Depending on the testing results, it will either have a green circle or a red one. CourseNana.COM

Then you will be taken to the following page. Click on “Autograding” CourseNana.COM

  • Then you will see the following page. Click on the third option that deals with autograding CourseNana.COM

PROGRAMMING 2 – SPRING 2023 CourseNana.COM

That list open up a very detailed description of the testing process. You need to scroll all the way down to the bottom, where you should something similar as the image below: CourseNana.COM

The first box will hold all the test results and their relevant description. The second box on the bottom will show the total points you received for the exercise. It will be out of a maximum of 10 points CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Programming 2代写,Flights-of-Fancy代写,Java代写,Programming 2代编,Flights-of-Fancy代编,Java代编,Programming 2代考,Flights-of-Fancy代考,Java代考,Programming 2help,Flights-of-Fancyhelp,Javahelp,Programming 2作业代写,Flights-of-Fancy作业代写,Java作业代写,Programming 2编程代写,Flights-of-Fancy编程代写,Java编程代写,Programming 2programming help,Flights-of-Fancyprogramming help,Javaprogramming help,Programming 2assignment help,Flights-of-Fancyassignment help,Javaassignment help,Programming 2solution,Flights-of-Fancysolution,Javasolution,