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, 21.06.2019 22:40
State the parts of a variable declaration?
Answers: 2
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
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
question
Mathematics, 24.04.2021 03:20
question
Mathematics, 24.04.2021 03:20
question
Mathematics, 24.04.2021 03:20
question
English, 24.04.2021 03:20
Questions on the website: 13722361