Question: 3. World maps. Write a program Worldmap. java that reads boundary information of a country (or other geographic entity) from standard input and plots the

 3. World maps. Write a program Worldmap. java that reads boundary

3. World maps. Write a program Worldmap. java that reads boundary information of a country (or other geographic entity) from standard input and plots the results to standard drawing. A country consists of a set of regions (e.g., states, provinces, or other administrative divisions), each of which is described by a polygon. Input format. The first line contains two integers: width and height. The remaining part of the input is divided into regions. - The first entry in each region is the name of the region. For simplicity, names will not contain spaces. - The next entry is an integer specifying the number of vertices in the polygon describing the region. Finally, the region contains the x - and y-coordinates of the vertices of the polygon. For simplicity, if a region requires more than one polygon to describe its boundary, we treat it as multiple regions, with one polygon per region. Output format. Draw the polygons to standard drawing, using the following guidelines: Call stdDraw. setCanvassize() to set the size of the canvas to be widthby-height pixels. - Call stdDraw . setXscale() and StdDraw. setYscale() so that x coordinates of the canvas range from 0 to width and the y-coordinates range from 0 to height. Call stdDraw. polygon () to draw each polygon. Here are some sample executions for the input files usa.txt, russia.txt, and world. txt. Additional input files are available for 100+ countries and all 50 U.S.states

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 Databases Questions!