question
please provide java code
Codewriting You are provided with several services (see the Airlines Infoservices.java file). These services are hosted on different machines, so your requests are emulated like they are done over a network. Your task is to implement a priceTracker interface, specifically a method int getcheapestTicket(string originairport, string destinationAirport) in the file PriceTrackerImpl.java , which returns the price of the cheapest direct flight from the originAirport to the destinationAirport . Return 4 if there are no direct flights. Your solution should make requests as optimal as possible. Note that your service should not waste too much of the available resources and should work normally within a big application with many other services. Consider this as a TDD task - you are given pre-written unit tests which fail at the beginning, and your task is to implement a solution which makes them pass. . [execution time limit] 20 seconds UNIT TE or undtiona 2080 @一直三分地 al
java com codesignal services AirlinesinfoServices.java tickets Price Tracker.java Tracker.java X 6 AirlinesInfoServices..... X Saved 1 package com.codesignal.services; 2 3 import java.util.List; 4 5 public interface Airlines InfoServices { 6 /**** 7 * @return a list of the names of the avail 8 */ 9 public List<String> getAvailableAirlines(); 10 11 12 * @param airline the name of the airline 13 * @param originAirport the name of the sour @param destinationAirport the name of the airport 15 * @return the price of the ticket from origi destinationAirport 16 * when using the services of the airpor id airlineId 17 */ 18 public int getTicketPrice(String airline, Stri origi.nAirport, String destinationAirport); 19 } 20 /** Price Trackerlmpl.java test 14 vojava com codesignal tickets Airline.java FunctionalTests.java <> @ build.gradle NIT TESTS unctionalTests > basicTests(List, int, int) > com.codesignal.tickets. Functional Tests.basictests(List, 16] unctionalTests > basicTests(List, int, int) > com.codesignal.tickets. Functional Tests.basicTests(List, ind, nt) [7] org.opentest43. AssertionFailedError: execution timed out after 200 ms at org. junit.jupiter.api - AssertTimeout.assertTimeout PreemptivelyCassertTimeout.java:158) @-ÉESIE 17
multithread java Codewriting You are provided with several services (see the Airlines Infoservices.java file). These services are hosted
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am