SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 305 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 30 Oct 2017 My Price 9.00

A grid represents a field, have the cells drawn in different colour

Dear tutor,

There are a set of Object-Oriented related questions that should be implemented on this project(based on Java). Classes are provided in the src folder since it is an exported Eclipse project. The instructions are as follow:

First Level

A grid represents a field, have the cells drawn in different colours to represent the different surfaces that could be present. You should show four (4) different surfaces: brown dirt, light green grass, dark green trees and grey rocks. You can use just a single colour in the cell, you don't need to make it look like that surface. Each cell should be randomly assigned a surface upon its creation (constructor call).You may not change the signature of the Cell constructor from public Cell(int x, int y, int size) public Cell(int x, int y). This restriction means you will have to decide the surface type within the Cell constructor.

Second Level

Note: Put the first level code into a separate class called PassCell. That class won't be used but must not prevent compilation (i.e. it needs to compile but not run).

Instead of using the private field in the Cell class, make surface sub-class of Cell with an overridden paint method. This means you make four new classes, each of which will extend Cell. You won't be able to decide on the type of a cell in the Cell constructor anymore because you won't ever construct a Cell anymore, only one of the subclasses. Thus, you will need to find another place to make this decision

Third level

Is the second level solution better or worse than the first level solution? Why? Please explain the reasons completely well with examples from the code.

Attachments:

Answers

(5)
Status NEW Posted 30 Oct 2017 02:10 PM My Price 9.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)