This document discusses the development of a bus stop display system using Java code. It provides an explanation of the implementation methods and details the coding process.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Implementation Bus stop display system development is the main aim of this project. Here Java code for the bus stop display system is developed. And the implementation methods and explanation for the developed coding is given below (Douglass, n.d.). The BusStopDisplay class used to read the routes.csv file. It has the bus stop information such as bus number, source, destination, due at and status. It has eight records. The main function is the entry point for the Java Virtual Machine. The heading is bus stop displays. The FileReader and read() function used to read the CSV file (Foster & Price, 2005). The System.out.print used to print the results. Here print the bus route information. The fread.close() function used to close the file. 1
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Created the array list for storing the route information. The route_information is the object. It is used to add the bus details to the array list. The add keyword is also used to add the details to the array list. There are eight records are added to the array list (Friesen, 2000). The HasExpectedBuses class used to read the timetable.csv file. It has bus arrival and departure time. The FileReader and read() used to read the file. The close() function used to close the file. 2
The Route class has four variables such as route_source, route_destination, route_num, and distance. These variables data type is a string. The RoutesAndStopInfoParser is the constructor. The bus is the object of the routedAndStopInfoParser (Markham, 2014). TheRouteistheconstructor.Ithasfiveargumentssuchasroute_no,route_start, route_terminate, and distance_value. The above code is to display the bus stop information. It has the route id, source, destination, and distance. The bus object used to invoke the toString function . 3
In the above section of the code class “RoutesAndStopParser” is shown. It helps to show the calling routes, seat number and times, etc. The class contains four variables on it. And they are callingRoutes,seat_number,departuretimes,andspeed_value.Theconstructorhasfour variables. And they are b_num, cap, dri, and sp (McAffer, Lemieux & Aniszczyk, 2010). The getCallingRoutes() method used to get the bus routes. It return the calling routes value. It data type is integer. The getseat_number() method has the bus available seat numbers. It data type also integer (Schmuller, 2004). The getDepartureTimes() method used to find the bus departure time and also is remain the bus display status such as on time, delay and cancelled. It data type is string. 4
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Theabovecodesareinvokethegetspeed_value()andsetDepartureTimes().The setDepartureTimes has the dri_name arguments. The getspeed_value() used to get the bus speed value. it return the speed value. it data type is string and it has the public access modifier. In the developed code all outputs are stored as different formats like int, float, etc. But for displaying purpose string format is preferred. So that we need to convert the output into the string. For that, we used a "toString" function. It converts output values (different format) into strings. Then the code executed and shows the results in the required format. 5
Output In the above screenshot, the information founded from the given CSV file is shown. The developed code initially collect and store the information present in the attached CSV file. So all 6
the data present in the three CSV files are shown here. The attached CSV file contains the details like number, source, destination due at and current status. Then the coding process the data and shows the bus routes and time similar to the below-attached screenshot. And the screenshot contains the information like Route Id, Source and destination and distance (Scott, 2001). Also, the output shows the information in a simple and understandable manner. And the output screenshots were shown in the below context. 7
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
UML daigram There are five classes in the UML diagram such as Time table, Route, Expected bus, Bus stop display, and Route alert. The time table has the bus number and due at variables. It is associated with the expected bus. It has a bus number, available seats, and status variables. It composition to bus stop display class. 8
The bus stop display has four variables such as routeId, source, destination, and distance. And it has two methods such as RoutesAndStopInfoParser() and Route(). It is composed to the Route class. The route class has three variables and methods. It associates to the routealert. It has three variables and two methods such as getCallingRoutes() and getDepartureTimes(). There are two data types defined in the UML diagram such as dueat and routeid. The dueat has hours and minutes. The enumeration is created for status. It has cancelled, ontime and delay. References Douglass, B.Real-time UML workshop for embedded systems. Foster, J., & Price, M. (2005).Sockets, shellcode, porting & coding. Rockland, Mass.: Syngress Pub. Friesen, J. (2000).Java 2 by example. Indianapolis, Ind.: Que. Markham, N. (2014).Java programming interviews exposed. Hoboken: Wiley. McAffer, J., Lemieux, J., & Aniszczyk, C. (2010).Eclipse Rich Client Platform. [Upper Saddle River, N.J.]: Addison-Wesley. Schmuller, J. (2004).UML. Indianapolis: Sams. Scott, K. (2001).UML explained. Boston [u.a.]: Addison-Wesley. 9