Comprised of a two-dimensional grid of cells

Assignment Help Basic Computer Science
Reference no: EM13935895

The farm area that is operated on during the game is comprised of a two-dimensional grid of cells, each representing a plot of land. These cells are referenced by a coordinate pair; e.g. (2, 3). This land can be used to cultivate crops or graze livestock in order to generate revenue; however there are costs involved in preparing the land and maintaining it on a monthly basis.

The game board should be able to calculate a sum of all costs and revenues associated with its constituent land plots. In the object design, the farm area specification must not be specific to one specific kind of implementation (hint: define an interface for all actions that are required of it.) Land plots can be either owned by the player, or available for sale to the player. At the start of the game, a certain number of plots of land are owned by the player; other plots can be bought as the game progresses. Each piece of land has a purchase price (these prices are the same for all plots of land in the farming grid.) Only owned land can be used for producing revenue. It is only possible to purchase land that is adjoining a plot of land that is already owned. Land that is owned by the player incurs a monthly cost to represent the task of maintenance. Owned land can be sold to generate revenue; when this happens, the land is made available for future purchase. If an occupied [with produce] plot of land is sold, the produce on that plot is surrendered, and the land becomes polluted. Land may also be polluted from either dead crops or livestock use (explained further in the specific sections below); when this occurs, the land must be recultivated before it can be used again. Land status is persistent (for example, selling polluted land and then re-purchasing it will not recultivate it to a clean state.) Each land plot must be able to report its status (clear, polluted, or occupied by a particular produce type.)

Produce Types All produce types have a name, and have the ability to report:

• Preparation costs

• Monthly maintenance cost

• Monthly revenue

• Current sale valueFrom this base definition, specific produce types are defined. In addition to the basic produce functionality listed above, crops must follow the following rules, and such functionality should be added to allow the following:

• Crops have a set preparation and monthly maintenance cost.

• Crops have no monthly revenue.

• Crops must have been bought and grown for a certain number of months before they are mature for sale. Crops that are not yet mature have no value.

• Immature crops can be abandoned by attempting to sell them - in this case, they are Sold with no value, and the land must be recultivated before it can be used again.

• Mature crops are considered commodities: all crops of a certain type have the same value, and this value varies from month to month. (The value variance will be implemented through the use of a mathematical formula.)

• Some time after crops reach maturity they die, and lose all their value. Furthermore, if crops are left to die on a plot of land, that land must be recultivated before it can be used for any other activity. If crops are sold before they die, no recultivation is needed. There are two kinds of crops in the game: wheat and apples. The object design should be written so that it is conceptually easy to add more crop types in the future. Livestock The specific attributes of livestock are as follows:

• Livestock have a set preparation and monthly maintenance cost.

• Livestock generate a constant monthly revenue (e.g. cow's milk, sheep's wool, etc.)

• Livestock are also considered commodities: they can be sold at a market price, that varies monthly.

• Livestock last forever. There are two types of livestock in the game: cows and sheep. As with crops, the object design should make adding more livestock types in the future easy to implement. Game Calendar The calendar is based on a yearly cycle of 12 months, stored as a simple integer count. The number 0represents January 2000, 1 is February 2000, 12 is January 2001, and so on. It is not possible to go back in ti me. It is only possible to move forward one month at a time. At the signal to move from one month to the next, all costs and revenues must be calculated and applied. Events such as the maturity or death of crops for the coming month should be acted upon at this time. Sales and purchases occur instantly. Events and Priority Queue In order to track events, a priority queue must be maintained, based on the month. This is a data structure which stores a number of events, each of which is made of an event type, the produce that is affected, and the time at which it is supposed to happen. The data structure will be able to keep everything in chronological order, and return all the events that are going to occur at a particular month. The following events must be tracked: • When a crop becomes mature

• When a crop is almost about to die (one month's warning)

• When a crop is going to die

• Any other events (if any) you consider appropriate. At the beginning of each month, it is intended that the program would query the priority queue for any events that are pending, and apply those changes to the land as necessary. Events must be able to distinguish between crop cycles; for example, if a plot of land is used for crops and successfully sold, and then re-established as a new crop field, the death event for old crop should not apply to the new crop in the same location. Important Note: you do not need to worry about how the priority queue will work internally; for the design it is only necessary to consider what kinds of operations (add, delete, etc.) the priority queue should offer. Like the land plot collection, in the object design, the priority queue should be defined as a generic interface of all operations that are required of it, and not based on a specific internal implementation The controller uses the other functional areas of the design in order to encapsulate and implement the game logic. The ultimate object of the game is to build a profitable farm. If the player goes bankrupt, the game ends. The available transactions the user may take are as follows:

• Purchase, sell or recultivate a land plot

• Buy or sell a particular crop or livestock at a land plot

• Move to the next month The controller, when issued with these instructions by way of a method call, should interact with the other parts of the program where relevant in order to complete the task. The game is turn-based; the user commands the program to move from one month to the next once they have finished making decisions for that month. There is no limit to the number of transactions a player can make in any one month.The controller is not the user interface; it is the code that the user interface will interact with in order to control the game in progressoriented concepts such as composition, inheritance, method overriding, abstract classes, interfaces wherever appropriate.
Further Questions

You will also need to answer the following questions with respect to your design.

1. Explain how the events in your design are going to know what produce type to affect, and how these changes are going to be implemented.

2. In your design, explain how the events will not affect different crop cycles (for example, the crop cycle scenario presented in the problem description above.)

3. Explain how your object design is going to handle the following operations: a) The preparation of a land plot for produce. Being able to maintain the crop life cycle of preparation, maturity, and death, and updating factors such as value, land status, etc. appropriately. c) The monthly calculation of all costs (land and produce maintenance costs) and revenues (monthly produce revenue) for the farm

Reference no: EM13935895

Questions Cloud

Describe the exact nature of the malaysian sukuk : Describe the exact nature of the Malaysian Sukuk. What Islamic modes of finance underpin the Malaysian Sukuk? Describe how these modes of finance work and the exact relationship they have with the Malaysian Sukuk
How might relationship be distorted by political conditions : Does the effect of Russian inflation on the decline in the rouble's value support the PPP theory? How might the relationship be distorted by political conditions in Russia?
Kinds of ineffective followership traits does ralph exhibit : What kinds of ineffective followership traits does Ralph exhibit? As an effective follower, how could you respond to Ralph in a way that would encourage him to develop positive followership behaviors?
What islamic modes of finance underpin the idb sukuk : Describe the exact nature of the IDB Sukuk, What Islamic modes of finance underpin the IDB Sukuk? Describe how these modes of finance work and the exact relationship they have with the IDB Sukuk
Comprised of a two-dimensional grid of cells : The farm area that is operated on during the game is comprised of a two-dimensional grid of cells, each representing a plot of land. These cells are referenced by a coordinate pair; e.g. (2, 3). This land can be used to cultivate crops or graze li..
Positive and negative attributes of the leadership style : Research the many leadership styles in management. Select one style and write a report that describes the positive and negative attributes of the leadership style and how you identify with it. (550 words)
Computes the wind-chill factor for a given temperature : The user should be able to enter a temperature and wind speed via text boxes, then click a button to view the corresponding wind-chill factor in a separate text box. As part of your page, you should define a function named Wi ndChi 11 that accepts..
Difference in profit between the two income statements : Reconcile the difference in profit between the two income statements.
What laboratory tests would confirm the diagnosis : What disease is suggested by the combination of fever, rash, and white spots on the patient's buccal mucosa? What pathogen causes this disease? What are the white spots called?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Calculate each student average and grade for the class

Also print a report of the each student's test grades, average and final grade as a table, and then print the averages of each Test and overall Test Average, as well as highest Test Grade of all Tests and the student with the highest class grade.

  Design a case structure that tests the month variable

Design a case structure that tests the month variable and does the following

  Two-dimensional arr named number of three rows

Given a two-dimensional arr named number of three rows and four columns of type ont, write the nigle code statement that both declare and initialize the arry such that the first row is initialize to 0,1,2,3, the second row is initialized to 4,5,6,..

  Describing the hardware and software used to support

Write a 1100-1350 word paper describing the hardware and software used to support personal, workgroup, and enterprise computing within your current organization, an organization with which you are familiar, or an organization that you can inte..

  Print a header line with appropriate labels for each column

Print a header line with appropriate labels for each column. Format each data line to vertically align each column right-justified.

  Design circuit buffer last-in first-out lifo

I want design circuit this Buffer(LIFO). This blocking is for FIFO memory but i want design circuit Buffer Last-in First-out LIFO 4*4

  Statement that returns columns from the products table

A column named Discount Amount that uses the previous two columns to calculate the discount amount and uses the ROUND function to round the result to 2 decimal places.

  What is netwitness visualizer

What is Netwitness Visualizer. How can it play a role in a Cybercrime investigation?

  Useful principle about it management

The novel is generally about what IT Development and Operations (Dev-Ops) has to learn from manufacturing. Summarize as a list, what these recommendations are. For each recommendation, list a page in the novel where the recommendation is made or r..

  Explain method to determine if a string is a palindrome

Need to code a recursive method to determine if a String is a palindrome, a palindrome is a word, phrase or sentence that is symmetrical; that is, it is spelled the same forward and backward.

  How the pages hold style continuity in grid system

Export the finished article as PDF format AND also give me the original indesign file, and the fonts you used.

  Are there any potential performance penalties

Would there be any situations where individual permissions would be used? In doing so, are there any potential performance penalties when using individual permissions?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd