subject

Computer science jobs are in demand. Right now we have a shortage of people that can do computer programming, and one of the fastest growing areas of new jobs in the sector are so-called hybrid jobs. This means you specialize in an area like biology, and then use computer programming to do your job. These hybrid jobs exist in the arts, sciences, economics, healthcare, and entertainment fields.

One of these jobs is computational biology. Computational Biology, sometimes referred to as bioinformatics, is the science of using biological data to develop algorithms and relations among various biological systems.

The scenario: Lily's Longitude/Latitude

In this activity, we are going to write a program which could be used to investigate data about the movements of a grey seal named Lily, who has been fitted with a GPS tracker.

Take a look at Lily's data here: Lily the Seal: movement data (Links to an external site.). You might spot that each row of data contains a longitude and latitude value (labeled Lon1 and Lat1). Longitude measures how far east/west on the Earth something is: the minimum/maximum value is at -180/180 degrees and is in the Pacific Ocean, while 0 degrees is the Grenwich meridian, cutting through London, UK. Latitude measures how far north/south something is. It ranges from -90 degrees (the south pole) to 90 degrees (the north pole) with the equator at 0 degrees.

The activity

Write a program into which we could enter Lily’s Longitude and Latitude data. Each time a new longitude and latitude is entered it should ask if you want to continue - the program should continue to ask for input if the user enters 1, and stop when the user enters 0. If an invalid pair of coordinates entered by the user (i. e. with latitude not between -90 and 90 inclusive or longitude not between -180 and 180 inclusive) then the program should print "Incorrect Latitude or Longitude".

Once the user has finished inputting data, the program should display the farthest distance traveled by Lily in each direction (you may assume the user has entered at least one valid longitude/latitude pair). However any invalid pairs of coordinates should be ignored when calculating these values - this includes ignoring a valid latitude if it is entered with an invalid longitude and vice-versa.

The farthest points are given by:

Farthest North - maximum latitude
Farthest South - minimum latitude
Farthest East - maximum longitude
Farthest West - minimum longitude
Please note - you are not expected to enter all of Lily's data into your program: you can simply make up some sample data points if you wish.

Sample Run:

Please enter the longitude:
69.938
Please enter the latitude:
41.678
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.862
Please enter the latitude:
41.755
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.947
Please enter the latitude:we are
41.829
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.988
Please enter the latitude:
300
Incorrect Latitude or Longitude
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.904
Please enter the latitude:
41.827
Would you like to enter another location (1 for yes, 0 for no)?
0
Farthest North: 41.829
Farthest South: 41.678
Farthest East: 69.947
Farthest West: 69.862
To help you with the development of this code, here are some useful milestones to consider. Note - these milestones encourage you to write the code in an iterative way: you will write a program with basic functionality and test it, then add more features in each milestone, rather than writing code in the order it appears in the program.

Milestone 1: Set up a scanner and an int variable to hold the answer to the question "Would you like to enter another location (1 for yes, 0 for no)?". Write a while loop based on this variable and add code to it which asks this question and gets an int response from the user.

Milestone 2: Write print/input statements to get the user to enter longitudes and latitudes inside the while loop. Write code which tests if these are both valid, and prints "Incorrect Latitude or Longitude" if not.

Milestone 3: Set up variables at the start of your program to hold the maximum and minimum longitudes and latitudes - set these to appropriate starting values based on the limits for longitude and latitude. Add code in the while loop which compares these values to the current maxima/minima and updates as appropriate. Write final print statements to print out the farthest North/South/East/West positions using these values.

(JAVA PLS)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
Answers: 1
You know the right answer?
Computer science jobs are in demand. Right now we have a shortage of people that can do computer pro...
Questions
Questions on the website: 13722359