WorldTemperature.com is a website which list various temperature of cities all over the world. In their website, some cities use different metric temperature; Celsius (C) and Fahrenheit (F). In the next month, they want to add a feature to sort the list of cities based on their temperature; from the coldest to the hottest cities. Nevertheless, they still want to keep the original temperature metric for all cities. Format Input All temperature data are stored in a file named testdata.in with maximum N lines. Each line contains three data, those are: City Name, Temperature, and Metric. Each data is separated by # as a delimiter. Format Output N lines temperature data which list the coldest to the hottest cities. If two or more cities have the same amount of temperature, sort them by using city name in ascending order (A-Z). The format of the output is “[city name] is [temperature][metric]”. Use a two-digit comma separated number format for the temperature. Constraints • 1 ≤ N ≤ 100 • 1 ≤ Length of City Name ≤ 1000 • −60 ≤ temperature ≤ 224 Sample Input (testdata.in) Jakarta#28#C New York#37.4#F Tokyo#9#C London#9#C Singapore#27#C Vancouver#-1#C Taipei#64.4#F Denver#-4#C Santiago#69.8#F New Delhi#11#C Sample Output Denver is -4.00C Vancouver is -1.00C New York is 37.40F London is 9.00C Tokyo is 9.00C New Delhi is 11.00C Taipei is 64.40F Santiago is 69.80F Singapore is 27.00C Jakarta is 28.00C Note: Celcius = (Fahrenheit − 32) ∗ 5/9 Please Use Standard C Language and Simple Code Do not use header include stdlib.h
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
WorldTemperature.com is a website which list various temperature of cities all over the world. In their website, some cities use different metric temperature; Celsius (C) and Fahrenheit (F). In the next month, they want to add a feature to sort the list of cities based on their temperature; from the coldest to the hottest cities. Nevertheless, they still want to keep the original temperature metric for all cities.
Format Input
All temperature data are stored in a file named testdata.in with maximum N lines. Each line contains three data, those are: City Name, Temperature, and Metric. Each data is separated by # as a delimiter.
Format Output
N lines temperature data which list the coldest to the hottest cities. If two or more cities have the same amount of temperature, sort them by using city name in ascending order (A-Z). The format of the output is “[city name] is [temperature][metric]”. Use a two-digit comma separated number format for the temperature.
Constraints
• 1 ≤ N ≤ 100
• 1 ≤ Length of City Name ≤ 1000
• −60 ≤ temperature ≤ 224
Sample Input (testdata.in)
Jakarta#28#C |
Sample Output
Denver is -4.00C |
Note: Celcius = (Fahrenheit − 32) ∗ 5/9
Please Use Standard C Language and Simple Code
Do not use header include stdlib.h
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images