Question

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 the equator Is between 0 and 90
That location is south of the equator Is between -90 and 0
That location does not have a valid latitude! Is greater than 90 or less than -90

and one of the following messages to describe the longitude entered:

Your program should display If the longitude entered
That location is on the prime meridian. Is 0
That location is east of the prime meridian. Is between 0 and 180
That location is west of the prime meridian Is between -180 and 0
That location does not have a valid longitude! Is greater than 180 or less than -180

If the user enters something other than a number, give them an error message and restart the program. Save your script as latlon.py.

My issue is that I am able to write a block of code for latitude and longitude each and am able to get the proper output phrase to come out, but when I try adding the sections of code where the program is checking to make sure that the input is valid I end up running into errors. It may just be that I don't quite know how to format and use the indentations yet, but I could really use some help on this one.

Homework Answers

Answer #1

Hey, there are two functions with try and catch blocks that show an error if input is not an integer. After that the main function starts. Hope this helps.

Output :

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
#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...
For this assignment you'll be creating an application that has the user input a subtotal, tax...
For this assignment you'll be creating an application that has the user input a subtotal, tax rate and tip percentage and then displays the sales tax, tip amount and the total. You'll use JQuery instead of the getElementByX functions AND you will display all messages on the page (no alert or prompt boxes) The starter file is based off of the Lab 2 sales_tax application. Feel free to borrow code from your lab solution but realize you will need to...
Please Write the whole program in assembly i am able to calculate the fibonacci series but...
Please Write the whole program in assembly i am able to calculate the fibonacci series but not sure how to print it in reverse order. Please give a Complete code !! Programming Exercise 1 (10 points): [call it Ass2-Q1.asm] Write an ASM program that reads an integer number N and then displays the first N values of the Fibonacci number sequence, described by: Fib(0) = 0, Fib(1) = 1, Fib(N) = Fib(N-2) + Fib(N-1) Thus, if the input is N...
Here is the code I am supposed to Analyze: // If we want to use the...
Here is the code I am supposed to Analyze: // If we want to use the Scanner class (type) to get user input, we need // to import the following Java package that includes the Scanner class // definitions. We do not have to add an import statement to use the // print() or println() methods of the System object, because they // are built in. import java.util.Scanner; public class PRG420Week1_AnalyzeAssignment { /* The main() method you see below is...
I did already posted this question before, I did get the answer but i am not...
I did already posted this question before, I did get the answer but i am not satisfied with the answer i did the code as a solution not the description as my solution, so i am reposting this question again. Please send me the code as my solution not the description In this project, build a simple Unix shell. The shell is the heart of the command-line interface, and thus is central to the Unix/C programming environment. Mastering use of...
I can open the file in the program, but I cannot figure out how to properly...
I can open the file in the program, but I cannot figure out how to properly split the data and assign a grade to the number values in the text file. I keep getting :: ValueError: invalid literal for int() with base 10: 'Roger Jones 75\n' Below are the assignment details: This program processes grades for a small class. It reads an input file named grade_input.txt where each record contains a student’s first name, last name and numeric grade (a...
Part 1 Write a program that reads a line of input and display the characters between...
Part 1 Write a program that reads a line of input and display the characters between the first two '*' characters. If no two '*' occur, the program should display a message about not finding two * characters. For example, if the user enters: 1abc*D2Efg_#!*345Higkl*mn+op*qr the program should display the following: D2Efg_#! 1) Name your program stars.c. 2) Assume input is no more than 1000 characters. 3) String library functions are NOT allowed in this program. 4) To read a...
Below is the problem that I have and here is the code that I have in...
Below is the problem that I have and here is the code that I have in c++. Can someone help me on what I am doing wrong or the correct code. A teacher has asked all her students to line up according to their first name. For example, in one class Amy will be at the front of the line, and Yolanda will be at the end. Write a program that prompts the user to enter the number of students...
The project CreateDirectoriesDemo is included with the files for this chapter as a zipped file. rewrite...
The project CreateDirectoriesDemo is included with the files for this chapter as a zipped file. rewrite the program so that it asks the user for the location where the new directories are to be created, and then asks the user to enter, one at a time, the relative path names of the directories it should create. Amended additional details to the above abstraction of the requirements. The application should be multiplatform adaptive. This means that it should work on an...
In Chapter 9, you created a Contestant class for the Greenville Idol competition. The class includes...
In Chapter 9, you created a Contestant class for the Greenville Idol competition. The class includes a contestant’s name, talent code, and talent description. The competition has become so popular that separate contests with differing entry fees have been established for children, teenagers, and adults. Modify the Contestant class to contain a field that holds the entry fee for each category, and add get and set accessors. Extend the Contestant class to create three subclasses: ChildContestant, TeenContestant, and AdultContestant. Child...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT