Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in JAVA: This is all the information we are given 2. Your friend is a surveyor who is plotting the sections of land in

image text in transcribedWrite in JAVA: This is all the information we are givenimage text in transcribed

2. Your friend is a surveyor who is plotting the sections of land in an unmapped area of Alaska. A section of land covers one square mile and contains 640 acres of land. Your friend has divided the section they are surveying into 128 horizontally or vertically contiguous, congruent, rectangular plots of land each containing 5 acres. Below is a diagram of a 640 -acre section of land that has been subdivided as noted in the diagram and chart below. To visualize the survey on paper, they have created a section grid that is 8 rows by 16 columns. Each cell of the grid represents one 5-acre plot of land. Some prospectors from the big Alaska gold rush have already staked claims on some of the 5-acre plots of land. Your friend decided to denote those plots with capital letters of the alphabet using a unique letter of the alphabet for each prospector. A lot is a piece of land that contains all the unclaimed plots that are surrounded by either the border of the section or by a prospector's claim. Write a program that will tell how many acres are in each of the lots that lay unclaimed. Input will be from a data file. The first line of input will contain a single integer n indicating the number of surveys to follow. Each survey will contain one section grid of 8 rows with 16 characters in each row. The characters in each row will be a capital letter [A,Z] indicating who owns the plot of land, or an asterisk () indicating an unclaimed plot of land. There will be a blank line following each section grid except for the last section grid. For each labeled survey, output to the screen on a single line the number of acres available in each unclaimed lot from largest to smallest and separated by a space. Let the user enter the file name from the keyboard. Refer to the sample output below

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions