Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

preferrably in JAVA or Scala . 1. A number of Base Stations are located on a square grid of cells. The lower left cell on

image text in transcribed

preferrably in JAVA or Scala

. 1. A number of Base Stations are located on a square grid of cells. The lower left cell on the grid is located at (0, 0), the cell on its immediate right is at (1, 0). For this exercise, use a 21x21 grid, so the upper right cell of the grid is at (20, 20). Your program should also work correctly for grids of other sizes however. Each Base Station has a name and a cell. These are read from the file base_stations.txt, which provides the name of the station, followed by the coordinates of its containing cell. a Create the following classes: Cell (a location on the grid), Base Station (name and Cell) and Base Stations (a number of Base Station objects). Add to each of these classes a to_s method that returns a string representing the object. In main.rb, instantiate Base Stations and add to it Base Station objects created using the data in base_stations.txt. Invoke to_s on the Base Stations object to produce this output: Here are the base stations: Alpha (10,10) Beta (4,10) Gamma (10,16) Delta (10,4) Epsilon (16,10) . 1. A number of Base Stations are located on a square grid of cells. The lower left cell on the grid is located at (0, 0), the cell on its immediate right is at (1, 0). For this exercise, use a 21x21 grid, so the upper right cell of the grid is at (20, 20). Your program should also work correctly for grids of other sizes however. Each Base Station has a name and a cell. These are read from the file base_stations.txt, which provides the name of the station, followed by the coordinates of its containing cell. a Create the following classes: Cell (a location on the grid), Base Station (name and Cell) and Base Stations (a number of Base Station objects). Add to each of these classes a to_s method that returns a string representing the object. In main.rb, instantiate Base Stations and add to it Base Station objects created using the data in base_stations.txt. Invoke to_s on the Base Stations object to produce this output: Here are the base stations: Alpha (10,10) Beta (4,10) Gamma (10,16) Delta (10,4) Epsilon (16,10)

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

Monthly Bank Reconciliation Statement Log

Authors: Elizabeth S.R.M. Cole

1st Edition

1541036824, 978-1541036826

More Books

Students also viewed these Accounting questions

Question

What is an asset? A liability? Net worth, or capital?

Answered: 1 week ago

Question

=+b) What is the best choice using the expected-value approach?

Answered: 1 week ago