Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions