Build your project in NetBeans using the Run – Build Project

Build your project in NetBeans using the Run – Build Project, or Run – Clean and Build Project menuitem.From the dist directory you will execute your program from the command line with two filenames asarguments, input file name and output file name. For example:java -jar lab5.jar..input.txt ..output.txtWrite a java program that will prompt the user for two city and province names from a select list.Read each of the records from the input file and extract the two records that match thoserequrested by the user.Define a class named Cruncher which will do all the ‘heavy lifting’ in this program.The main line of your solution will look exactly like this:public static void main(String[] args){if(args.length < 2){System.err.println(‘Usage: java -jar lab5.jar infile outfile’);System.exit(99);}Cruncher dataManipulator = new Cruncher(args[0], args[1]);dataManipulator.openFiles();dataManipulator.findDistance();dataManipulator.writeRecords();dataManipulator.closeFiles();}Latitude is measured in degrees and minutes with zero at the equator and 90 degress at the North pole or South pole. Latitude has to be expressed as North or South. There is usually a third number, seconds but it is not in our data, just degrees and minutes. Longitude is also measured in degrees and minutes with zero located a little outside London England (Greenwich). Longitude must be expressed as West or East and it ranges from zero to 180 degrees. All the data in Canada will be North and West and simplifies our calculation a little bit.Here is the code to calculate the distance between two cities given longitude and latitude:double earthRadius = 6371; // in kmdouble distance = Math.acos(Math.sin(Lat1) * Math.sin(Lat2) +Math.cos(Lat1) * Math.cos(Lat2) *Math.cos(Long2 – Long1)) * earthRadius;The values you feed into the trig functions are in radians. You will be readingstrings of text in degrees and minutes. So your program will have to convertstrings to doubles as degrees and minutes and then convert those doubles todecimal degrees and then convert that to radians. Here is a non-Javadescription of what I mean:degree = 23minute = 45decimaldegree is then 23.75 because there are 60 minutes in a degree ( our data does not have seconds )radians = decimaldegree * PI/1807 mins agoMatc

Did you know you can hire someone to answer this question? Yes, is a hub of paper writers dedicated to completing research and summaries, critical thinking tasks, essays, coursework, and other homework tasks. It is simple as ABC.