Question

#Write a function called semihemisphere. semihemisphere #should return which semihemisphere a latitude-longitude #coordinate pair is in:...

#Write a function called semihemisphere. semihemisphere
#should return which semihemisphere a latitude-longitude
#coordinate pair is in: Northwest, Northeast, Southwest,
#or Southeast. A point in the Northern and Western
#hemispheres would be Northwest; in the Southern and Eastern
#hemispheres would be Southeast; etc.
#
#semihemisphere will take as input two floats: latitude
#and longitude. Latitude is a number between -90 and 90
#representing the North-South position on the globe (-90
#for the South pole, 90 for the North pole). Longitude is
#a number between -180 to 180 representing the East-West
#position on the globe (-180 is the furthest west, and 180
#is the furthest east).
#
#The Southern hemisphere is from -90° to 0° latitude. The
#Northern hemisphere is from 0° to 90° latitude. The
#Eastern hemisphere is from 0° to 180° longitude. The
#Western hemisphere is from -180° to 0° longitude.


#Add your code here!

#Below are some lines of code that will test your function.
#You can change the value of the variable(s) to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print Northwest, Southeast, Northeast, Southwest
print(semihemisphere(33.7, -84.4))
print(semihemisphere(-71.1, 86.3))
print(semihemisphere(67.1, 12.1))
print(semihemisphere(-11.6, -62.3))

Homework Answers

Answer #1

Since you didn't specify any language , I am writing the function in c++ which is taking as argument two float values i.e latutude and longitude and then using if and else statements ,we are determing the quadrant of the point.

string semihemisphere(float latitude,float longitude)
{
    string s;
    if(latitude>0 && latitude<90)
    {
        s="North";
    }
    else
    {
        s="South";
    }
    if(longitude>0 && longitude<180)
    {
        s+="east";
    }
    else
    {
        s+="west";
    }
    return s;
}
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. The altitude of the North Celestial Pole Question 1 options: is always 0 is always...
1. The altitude of the North Celestial Pole Question 1 options: is always 0 is always 180 depends on the observer’s longitude depends on the observer’s latitude Question 2 (1 point) The azimuth of the North Celestial Pole Question 2 options: is always 0 is always 180 depends on the observer’s longitude depends on the observer’s latitude Question 3 (1 point) If you are in Saskatoon, Saskatchewan (Latitude = 52N, Longitude = 107W), where will you find the North Star?...
I am just beginning in a class called Geocomputing, and I have no background experience in...
I am just beginning in a class called Geocomputing, and I have no background experience in programming. Here is the problem: Write a Python script that asks the user to input the latitude and longitude of a location. After the user has entered the information, the script should display one of the following messages to describe the latitude entered: Your program should display If the latitude entered That location is on the equator. Is 0 That location is north of...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT