Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, this is Java programming language assignment. I would appreciate it if you could write it in a way that I can copy paste. It's

Hello, this is Java programming language assignment. I would appreciate it if you could write it in a way that I can copy paste. It's a bit of a long assignment so I won't forget to give feedback afterwards. Thank you

image text in transcribedimage text in transcribedimage text in transcribed

1. Design two classes: Flight and Itinerary. The Flight class stores the information about a flight with the following members: 1. A data field named flightNo of the String type with getter method. 2. A data field named departureTime of the GregorianCalendar type with getter and setter methods. 3. A data field named arrivalTime of the GregorianCalendar type with getter and setter methods. 4. A constructor that creates a Flight with the specified number, departureTime, and arrivalTime. 5. A method named getFlightTime() that returns the flight time in minutes. The Itinerary class stores the information es an Itinerary with the specified fights. A method named getTotalTime() that returns the total travel time in minutes from the depature time and the first flight to the arrival time of the last flight in the itinerary. Implement these two classes and use the follwing program to test these classes. public static void main(String[] args) \{ List flights = new ArrayList(); flights. add(new Flight("US230", new GregorianCalendar(2014, 4, 5, 5, 5, 0), new GregorianCalendar(2014, 4, 5, 6, 15, 0))); flights. add (new Flight("US235", new GregorianCalendar(2014, 4, 5, 6, 55, 0), new GregorianCalendar(2014, 4, 5, 7, 45, 0))); flights.add(new Flight("US237", new GregorianCalendar(2014, 4, 5, 9, 35, 0), new GregorianCalendar(2014, 4, 5, 12, 55, 0))); Itinerary itinerary = new Itinerary (flights); System.out.println(itinerary.getTotaltravelTime ()); System.out.println(itinerary.getTotalFlightTime()); 2. The popularity ranking of baby names from years 2001 to 2021 (top 1000) is downloaded from Www.ssa.gov/oact/babynames and stored in files named babynameranking2001.txt, babynameranking2002.txt, .., babynameranking2021.txt. Each file contains one thousand lines. Each line contains a ranking, a boy's name, number for the boy's name, a girl's name, and number for the girl's name. For example, the first two lines in the file babynameranking2010.txt are as follows: So, the boy's name Jacob and girl's name Isabella are ranked \#1 and the boy's name Ethan and girl's name Sophia are ranked \#2. 21,875 boys are named Jacob and 22,731 girls are named Isabella. Write a program that prompts the user to enter the year, gender, and followed by a name, and displays the ranking of the name for the year. Here is a sample run: Enter the year: 2010 > Enter the gender: M > Enter the name: Javier Javier is ranked \#190 in year 2010 Enter the year: 2010 Enter the gender F FEnter icon > The name ABC is not ranked in year 20

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_2

Step: 3

blur-text-image_3

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

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

=+ Is the time practical, based on the organization's resources?

Answered: 1 week ago