×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

Work With Airport Data Management System in Java Assignment Solution

June 29, 2024
Dr. Seraphina Stormcloud
Dr. Seraphina
🇬🇧 United Kingdom
Java
Dr. Seraphina Stormcloud is a highly accomplished computer scientist who obtained her PhD from the prestigious University of Oxford, followed by post-doctoral research at the University of Cambridge in the UK. With seven years of experience under her belt, Seraphina has completed over 700 Java Homework assignments with exceptional skill and proficiency.
Key Topics
  • Instructions
  • Requirements and Specifications
Tip of the day
Focus on understanding TensorFlow's computational graph and its eager execution mode. Use pre-built functions like tf.data for efficient data pipelines.
News
The latest version of Google's machine learning library, offering improved performance, streamlined APIs, and expanded support for reinforcement learning, making it a powerful tool for AI development.

Instructions

Objective
Write a java assignment program to work with airport data management system.

Requirements and Specifications

Program to work with airport data management system in java

Source Code

import java.io.IOException;

import java.nio.file.Files;

import java.nio.file.Path;

import java.nio.file.Paths;

import java.text.ParseException;

import java.text.SimpleDateFormat;

import java.time.LocalDate;

import java.time.LocalDateTime;

import java.time.ZoneId;

import java.util.*;

import java.util.stream.Collectors;

public class AirportData {

    private ListwedgePolygons;

    private static class Wedge {

    }

    private static void overWriteAirportDataStruct(String airportName, String svnPortal, int day_start, AirportData airportDataStruct) {

        String name = airportName;

        if (Arrays.asList("JKG").contains(name)) {

            name = "JFK";

        }

        try {

            SimpleDateFormat format = new SimpleDateFormat("MMddyy");

            Listlist = Files.list(Paths.get(svnPortal, "Data", "Maps", name)).collect(Collectors.toList());

            Listresults = new ArrayList<>();

            for (Path path : list) {

                if (path.toFile().isDirectory()) {

                    try {

                        String filename = path.getFileName().toString();

                        Date date = format.parse(filename);

                        LocalDate localDate = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()).toLocalDate();

                        long dateNum = localDate.toEpochDay();

                        if (dateNum <= day_start) {

                            results.add(dateNum);

                        }

                    } catch (ParseException ignored) {

                    }

                }

            }

            Collections.sort(results);

            if (!results.isEmpty()) {

                save(Paths.get(svnPortal, "Data", "Maps", name,

                        format.format(LocalDate.ofEpochDay(results.get(results.size() - 1))), name, "_AirportData"), airportDataStruct);

            } else {

                save(Paths.get(svnPortal, "Data", "Maps", name, name, "_AirportData"), airportDataStruct);

            }

        } catch (IOException e) {

            throw new RuntimeException(e);

        }

    }

    private static void computeWedgesAndWriteAirportData(String airportCode, int startDate, int numdays, String drive, String pathSuffix) {

        AirportData airportData = loadAirportDataStruct(airportCode, System.getenv("AirportalPath"), startDate);

        Listwedges = computeWedges(airportCode, startDate, airportData, numdays, drive, pathSuffix);

        boolean zoomable = true;

        drawAirport(airportData, zoomable);

        drawPolygon(wedges);

        airportData.wedgePolygons = wedges;

        String result = "";

        try (Scanner scanner = new Scanner(System.in)) {

            while (!result.equals("Y") && !result.equals("N")) {

                System.out.println("Do you want to save the airportData with wedges over the current airportData? Y/N");

                result = scanner.nextLine();

            }

        }

        if (result.equals("Y")) {

            overWriteAirportDataStruct(airportCode, System.getenv("AiportalPath"), startDate, airportData);

        }

    }

    private static ListcomputeWedges(String airportName, int dayStart, AirportData airportData, Integer numdays,

                                             String drive, String pathSuffix) {

        if (numdays == null) {

            numdays = 14;

        }

        if (drive == null) {

            drive = "M:\\";

        }

        if (pathSuffix == null || pathSuffix.isEmpty()) {

            pathSuffix = "";

        }

        ListaltOpsPath = Arrays.asList(drive, airportName, pathSuffix, "\\");

        int dayStop = dayStart + numdays - 1;

        ListallArrivals = new ArrayList<>();

        return null;

    }

    private static AirportData loadAirportDataStruct(String airportName, String svnPortal, int date_start) {

        String name = airportName;

        if (Arrays.asList("JKG").contains(name)) {

            name = "JFK";

        }

        try {

            SimpleDateFormat format = new SimpleDateFormat("MMddyy");

            Listlist = Files.list(Paths.get(svnPortal, "Data", "Maps", name)).collect(Collectors.toList());

            Listresults = new ArrayList<>();

            for (Path path : list) {

                if (path.toFile().isDirectory()) {

                    try {

                        String filename = path.getFileName().toString();

                        Date date = format.parse(filename);

                        LocalDate localDate = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()).toLocalDate();

                        long dateNum = localDate.toEpochDay();

                        if (dateNum <= date_start) {

                            results.add(dateNum);

                        }

                    } catch (ParseException ignored) {

                    }

                }

            }

            Collections.sort(results);

            if (!results.isEmpty()) {

                return load(Paths.get(svnPortal, "Data", "Maps", name,

                        format.format(LocalDate.ofEpochDay(results.get(results.size() - 1))),

                        name,

                        "_AirportData"));

            } else {

                return load(Paths.get(svnPortal, "Data", "Maps", name, name, "_AirportData"));

            }

        } catch (IOException e) {

            throw new RuntimeException(e);

        }

    }

    private static AirportData load(Path path) {

        return null;

    }

    private static void save(Path path, AirportData airportData) {}

    private static void drawAirport(AirportData airportData, boolean zoomable) {}

    private static void drawPolygon(Listwedges) {}

    public static void main(String[] args) {

    }

}

Related Samples

Discover our Java Assignments sample section, featuring expertly crafted solutions designed to support students. From fundamental concepts to advanced algorithms, each example offers clear, annotated code for enhanced learning. Explore practical Java programs that deepen understanding and proficiency, empowering students to excel in their programming endeavors.