Homework for my computer science lab
1.Objective:The objective of this programming project is to examinereadinga file, parsingdata,performingcalculation on data, andsome basics on Date/Time.After completing the project, studentswill have an intermediateunderstanding ofreadingfileand performing calculation ondataand basics of Date/Timefunction in Java.2.Project Specification:2.1.Overall ProgramBehavior:The futuristic smart city will have intelligent transportation systems where every vehicle will be able to communicate with each other. Hence accident will be prevented, and human lives and property will be saved. Also, driving will be much easier, in many cases, no traffic signal will be required.This is the concept of vehicular ad hoc network (VANET).For this project, we are using a dataset from a VANETclustering algorithmfrom here: https://doi.org/10.1007/s12243-021-00881-9. However, weare using a small portion of over one hundredthousanddata. We provided Driver.java and vanetp1data.txt [donot edit these two files]. You are required to create and write necessary classes, methods, etc.to complete the project based on this project description and Driver.java we provided. 2.2 InputFile:In this project wewill perform some basic operations on Date/Time and Stringwhich will be extended in the later projects. Your program isrequired toread thecontent of thefile provided, vanetp1data.txt. You will require some modificationon data to get the VehicleID(s)(vehicleID is the third column asa five-letter codesuch as vehi01, veh02, etc.). There are more than 50 vehicles,but you should declare anarray with a small capacitylike 10 or 20;and expand the capacity of the array when it is full.Also, when you are extracting vehicle ID, you need to convertthe vehicleID into uppercase letter, i.e., veh01 to VEH01.Some data are kept distorted, but do not edit the file, ratheryou shouldedit your content after reading the file.2.3Input Formatin Driver.java:For the first part,that includes Date/Time,pleaselook at the Driver.java filewhere the tasks/outputs have been described.For the second part, we have added a text filewhich contains some data including the vehicleID(vehicleID)in the thirdcolumn.You need to calculate the Hamming distance between the vehicles. The definition of Hamming distance has been described in the next Section.The input format is givenbelowfor illustration purpose only, the actual code on Zylab willbetestedforvarious input setswhich aredifferent than the input given as example.CS2334: Programming Structures and AbstractionProject1String, Date/Timewith VANET
OU:CS2334| Project 12Read this description along withDriver.java:If two vehicleIDsare entered, for example, HammingDist hammDist1= newHammingDist("VEH01", "VEH11");System.out.println(hammDist2);Then the output format is as follows:The Hamming distance between VEH00 and VEH01 is 1; between VEH00 and VEH11 is 2.For VEH01: Number of vehicles of Hamming Distance 1: 17.For VEH11: Number of vehicles of Hamming Distance 2: 80.Note: if two inputs are the same, then you shouldreverse the second input, for example, HammingDist hammDist1= newHammingDist("VEH20", "VEH20");Then, reverse the second input VEH20 as 02HEVandperform the calculationas shown above.2.4Description of output: HammingDist hammDist1= newHammingDist("VEH01", "VEH11");System.out.println(hammDist2);The Hamming distance between VEH00 and VEH01 is 1; between VEH00 and VEH11 is 2.For VEH01: Number of vehicles of Hamming Distance 1: 17.For VEH11: Number of vehicles of Hamming Distance 2: 80.First line is showing the Hamming DistancesbetweenVEH00 andthe first input (VEH01), and between VEH00andthe second input (VEH11).Here, the result is 1and 2respectively.The second line is for VEH01:We already got (The Hamming distance between VEH00 and VEH01 is 1) from previous line. Here, you need to calculatethe number of vehiclesin the datasetwhere the Hamming distance is 1from VEH01.In this case, it is 17.The third line is for VEH11: We already got the Hamming distance (between VEH00 and VEH11 is 2) from previous line. Here, you need to calculate the number of vehiclesin the datasetwhere the Hamming distance is 2 from VEH01. In this case, it is 80.A sample output file for the Driver.java is attached so that you can get clear ideaabout the ouput.Print the output in thisspecific format,since Zylab will gradeyouautomatically.
OU:CS2334| Project 133.Hamming Distance:The Hamming distance between two strings of equal length is the number of elements(letter or digit)wheretwo strings differ. In other words, it measures the minimum number of substitutions required to change one string into the other, or the minimum number of errors that could have transformed one string into the other. In a more general context, the Hamming distance is the number of positionsthat differsbetween two sequences.The following examples will make the idea clear.Example:“COME”and “GONE” COMEHamming DistanceGONEDifference: 1SameDifference:1Same1+1 = 2Another example:“GONE” and “NONE”GONEHamming DistanceNONEDifference: 1SameSameSame1For more examples, visit: https://en.wikipedia.org/wiki/Hamming_distance4.File names:Filenamesfor thisprojectare as follows:We areproviding: Driver.java, vanetp1data.txt(Don’t modify these two files)You will write:Necessary files