Question: A program read several lines of input that describe the job you want it to do , should not print any prompts to the user.

A program read several lines of input that describe the job you want it to do, should not print any prompts to the user. The first line of input will be in one of two formats: TARGET NOMINATIM location, where location is any arbitrary, non-empty string describing the target location. For example, if this line of input said TARGET NOMINATIM Bren Hall, Irvine, CA, the target of our analysis is Bren Hall on the campus of UC Irvine. The word NOMINATIM indicates that we'll use Nominatim's API to determine the precise location (the latitude & longitude) of our target point. TARGET FILE path, where path is the path to a file stored locally, containing the result of a previous call to Nominatim. The file needs to exist. The expectation is the file will contain data in the same format that Nominatim would have given you, but will allow you to test your work without having to call the API every time important, because Nominatim imposes limitations on how often you can call into it, and because this could allow you to make large parts of the program work without having hooked up the APIs at all. The second line of input will be in one of two formats: WEATHER NWS, which specifies that we'll use the National Weather Service API to obtain hourly weather forecasts. WEATHER FILE path, where path is the path to a file stored locally, containing the result of a previous call to the National Weather Service's API for obtaining an hourly weather forecast. The file needs to exist, but will allow you to test your work without depending on the National Weather Service API. The third line of input specifies the first weather query that the user would like answered, and will be in one of the following formats: TEMPERATURE AIR scale length limit, which means that the user would like to see the air temperature. scale indicates the temperature scale in which to report the result, with F and C. length is a positive integer indicating the number of hours into the future for which the query is being made (e.g.,24 means "over the next 24 hrs"). limit indicates whether the user is interested in seeing a max (by specifying MAX) or a min (by specifying MIN) over the specified number of hours. So, for example, TEMPERATURE AIR F 12 MAX means that the user would like to see the max air temperature over the next 12 hours, reported in degrees F. TEMPERATURE FEELS scale length limit, which means that the user would like to see the "feels like" air temperature. scale indicates the temperature scale in which to report the result, with F and C. length is a positive integer indicating the number of hours into the future for which the query is being made (e.g.,24 means "over the next 24 hrs"). limit indicates whether the user is interested in seeing a max (by specifying MAX) or a min (by specifying MIN) over the specified number of hours. HUMIDITY length limit, which means that the user would like to see the relative humidity, reported as a %. length is a positive integer indicating the number of hours into the future for which the query is being made (e.g.,24 means "over the next 24 hours"). limit indicates whether the user is interested in seeing a maximum (by specifying MAX) or a minimum (by specifying MIN) over the specified number hours. WIND length limit, which means that the user would like to see the wind speed, reported in miles/hr. length is a positive integer indicating the number of hours into the future for which the query is being made (e.g.,24 means "over the next 24 hrs"). limit indicates whether the user is interested in seeing a max (by specifying MAX) or a min (by specifying MIN) over the specified number hours. PRECIPITATION length limit, which means that the user would like to see the hourly chance of precipitation, reported as %. length is a positive integer indicating the number of hours into the future for which the query is being made (e.g.,24 means "over the next 24 hrs"). limit indicates whether the user is interested in seeing a max (by specifying MAX) or a min (by specifying MIN) over the specified number hours. Subsequent lines of input will specify additional weather queries, each in one of the same formats described above. Can assume that there will always be at least one weather query, but there is no limit on how many there might be. No rules restricting the order in which they might appear, nor are there rules preventing their duplication. Continue reading lines of input and treating them as weather queries until read a line of input in the following format: NO MORE QUERIES The final line of input will be in one of two formats: REVERSE NOMINATIM, which means that we want to use the Nominatim API to do reverse geocoding, i.e., to determine a description of where the nearest weather station is located. REVERSE FILE path, which means that we want to use a file stored locally, containing the results of previous calls to Nominatim's reverse geocoding API instead.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!