Implement a training system for company directors

Assignment Help JAVA Programming
Reference no: EM131222210

1 Problem Overview

You have been asked to design and implement a training system for company directors. In the best tradition of economics, we shall start by making things up.

The training system is intended to show people what would happen when they make certain buy/sell decisions. For our simplified purposes, a company owns a set of prop- erty. Each item of property is worth money, and so can be bought and sold. Over time, that property also generates an income for its owner (although in some situations that income might be negative; i.e. a cost to the company).

A company director (in training) can propose a plan. A plan consists of several proposed decisions, each one occurring at a particular point in time (in the future), and involving either buying or selling property.

The training system will simulate the consequences of a given plan over a number of years. For simplicity, all events in the simulation will take place at the start of a par- ticular year, and nothing changes during each year. The system will work from a set of input files that contain information about all property.

2 Property

All forms of property have:
- A monetary value (in $) - what the property is worth; and
- A profit (also in $) - the overall amount of money the owner gets in a particular year (which could be negative).
A company can own the following types of property:

Bank account. Each company always owns exactly one of these, and it cannot be bought or sold. Rather, the balance increases or decreases when other property is bought or sold, and when a profit or loss is made (see "companies" below for details). The company can go into debt, when the balance is negative. There are no upper or lower limits on the bank account balance.

Profit calculation: if the balance is positive, the company receives an amount of "interest" equal to 5% of the balance. For instance, if the account balance is $1,000,000 during 2017, then the company receives $50,000 in interest at the start of 2018. If the account balance is negative, the same interest calculation is applied, but the the result will be negative (that is, a loss rather than a profit).

Business units. These are factories, mines, call centres, etc. that employ people to pro- duce products and services. Business units can be bought or sold, and so they have an overall monetary value.

Profit calculation: a business unit generates revenue from whatever it sells, but must also pay wages to its employees. At the start of the simulation, each business unit has a particular yearly revenue, and a particular yearly wage payment (rep- resenting the combined yearly wages of all its employees). The yearly revenue can change, from year-to-year and from unit to unit. Wages can also change, but when they do, they change for the whole simulation.

Companies. Companies can buy and sell other companies. However, there cannot be a cycle in ownership relationships. That is, a company cannot own itself, nor can two companies own each other, nor can n companies form an ownership circle.

Profit calculation: Say s is the sum of the profit of whatever the company owns. If s ≤ 0, then the company's profit is 0, and its bank balance is reduced by s. Otherwise, the company's profit is 0.5s, and its bank balance also increases by 0.5s.

Every item of property has exactly one owner, which can either be a company within the simulation, or an "unnamed owner". The simulation must of course keep track of who owns what, although unnamed owners have no information to keep track of.

3 System Behaviour

The training system should take five command-line parameters: three filenames (for input files described in Section 4), a start year, and an end year. The simulation must run from the start year to the end year, inclusive, simulating a series of events and their consequences. There should be no user interaction!

While running, the simulation contains one or more companies, and zero or more busi- ness units. One of the companies is the primary company - the one that will be doing the buying and/or selling.

At the very start of the simulated time period, the bank account balance for all compa- nies begins at $0. All property-specific values are specified in one of the input files.

At the start of each year, the following things must happen, in this order:

1. Companies' bank accounts are updated to reflect the profit or loss they have made over the previous year. However, this only happens from the second year onwards (since nothing happens prior to the first year).

2. Companies' names and bank account balances should be outputted in an easy-to- read format, along with the current year.

3. A set of zero or more unplanned events take place that affect income and monetary value. Unplanned events can happen in any combination. Several events of the same type can also happen at once, in which case their effects are cumulative. The events are not random, though - they are specified in an input file.

The types of possible unplanned events are as follows:
- Wages may increase or decrease by 5% for all business units.
- The revenue for a specific business unit can increase or decrease by 5%.
- The monetary value of a specific business unit or company can increase or decrease by 5%.

These are all multiplicative changes. For instance, an increase in wages means that the simulation must multiply each business units' wages by 1.05. For a decrease, the multiplier is 0.95. (FYI, if an increase and decrease were to happen in the same year, they would not exactly cancel each other out, because 1.05 × 0.95 ƒ= 1.)

4. A set of zero or more buy/sell decisions are made, according to the plan proposed by the director-in-training. These are likewise specified in an input file.

The primary company can buy any business units that it does not already own. It can also buy any companies it does not already own, provided this would not create an ownership cycle (i.e. it cannot buy itself, or its owner, or its owner's owner, etc.). When buying something, the primary company's bank account will decrease by the value of the property bought. If the previous owner is a company within the simulation, that company's bank account increases by the same amount.

Note: a buy decision is still valid even if the company does not have enough money. In that case, its bank account balance simply becomes negative, implying that it has gone into debt.

The primary company can sell anything it does own, except for its bank account. When selling something, for simplicity, we always sell it to an "unnamed buyer" (who becomes the unnamed owner). The bank account of the primary company will increase by the current value of the property it sells.

4 Input Files

The training system will take its input from three different CSV (Comma Separated Value) files:
- The property file describes every business unit and company in the simulation;
- The event file contains a list of unplanned events;
- The plan file contains a list of buy and sell decisions.
The system should detect errors in the training files and report them appropriately.

The Property File

The property file contains one row for each item of property (plus one heading row), with six columns:
- The unique name of the item of property;
- The property type: "C" for company, or "B" for business unit;
- The name of the initial owner of the property, or empty if the owner is unnamed;
- The monetary value (in $) of the property;
- The revenue (in $) of the business unit, or empty if the property is a company;
- The wages (in $) of the business unit, or empty if the property is a company.
The primary company is the first company listed in the file (but not necessarily the first item of property).

The Events File

The events file contains one row for each unplanned event (plus one heading row), with three columns:
- The year when the event happens;
- The event type: "W+" for wages increase (across all business units), "R+" for busi- ness unit revenue increase (for a specific business unit), or "V+" for monetary value increase (for a specific business unit or company), or "W-", "R-" or "V-" for corresponding decreases;

- The name of the affected property (if the event type starts with "R" or "V"), or empty if the event does not concern a specific item of property ("W").
In a valid file, the events will be listed in chronological order. For instance:
Year,Event,Property
2017,R-,32 Bakers Street
2017,V+,Tumbleweed Co
2018,W-,
2018,V-,Tumbleweed Co
2019,W+,
2019,W+,
2019,R+,Cannington factory

The Plan File

The plan file contains one transaction per row (plus one heading row), with three columns
- The year when the transaction happens;
- The transaction type: "B" for buy, or "S" for sell.
- The name of the property to be bought or sold.
Like the events file, the transactions in the plan file should be listed in chronological order.
For instance:
Year,Buy/Sell,Property
2017,S,Cannington factory
2017,B,Kalgoorlie mine
2018,S,32 Bakers Street
2018,B,Tumbleweed Co
2019,S,Giblet Inc

5 Your Task

Design and implement this system, providing the following:

(a) Your design, expressed in UML, containing all significant classes, class relation- ships, and significant methods and fields.

(b) Your complete, well-documented code, in Java, C++ or Python (your choice). Do not use any third-party code without approval, in writing, from the lecturer.

Provide clear instructions for compiling and running your code.

Then, in 1-2 pages total, discuss the following issues:

(c) Where have you used polymorphism, and why? Discuss any design patterns you've used that incorporate polymorphism.

(d) How does your design achieve testability? That is, what have you done to make unit testing easier?

(e) Discuss two plausible alternative design choices, and explain their pros and cons.

(To do well here, show that you understand the range of possible solutions and their tradeoffs. If you simply say "I could have used pattern Y instead of X", you will get zero marks.)

Verified Expert

This assignment is related to the java programming. It has features like reading the data from the file and process it to produce the output. It consist of UML diagram that provides the details about the class and its attributes as well as the one docx file which contains the screenshot of the output as well as some answer of the question. There input file: events.txt, plan.txt, property.txt is used as the input for the program

Reference no: EM131222210

Questions Cloud

Illustration on our conversation about the disparities : View the excellent video, posted by Amrita. It is only 2 minutes long, but it provides such a great illustration on our conversation about the disparities in pay and working conditions between developed and developing countries.
Analyzes effects in terms of risk factors for humanitarian : Examines the impact on international security, politics, and global trade. Analyzes the effects in terms of risk factors for humanitarian dimensions of affected nations and peoples.
Explain the relationship between gangs and crime : Investigative reports are read by many people and used for many purposes. Which of the following is not an example of how a report would typically be used?
Explain the appropriate disciplinary action : Determine and explain the appropriate disciplinary action for the employees involved in this situation and identify motivational alternatives that can help turn the situation around;
Implement a training system for company directors : Object Oriented Software Engineering (COMP2003) - You have been asked to design and implement a training system for company directors. In the best tradition of economics, we shall start by making things up.
Anne of green gables by lucy maud montgomery-book review : Write a book review on “Anne of Green Gables by Lucy Maud Montgomery”, Publication: Broadview Press , Number of pages: 401, Year published: 2004
Determine whether market structure is perfectly competitive : Determine whether the market structure of the industry in which your chosen company operates is perfectly competitive, monopolistically competitive, oligopolistic, or monopolistic. Justify your response.
Social services intervened to remove joe : His mother began drinking heavily to deal with her depression and became alcoholic. Social Services intervened to remove Joe from his mother's care. Joe's grandmother took Joe in and raised him from infancy.
Procedures in conducting wage and salary surveys : What are the procedures in conducting wage and salary surveys?

Reviews

pri1222210

10/10/2016 11:42:38 PM

Expert says: For these company their balance are negative and according to the attached document we need to show the balance as zero if their balance are negative

pri1222210

10/10/2016 10:37:53 PM

Thank you for Excellent work!! i found it source perfect! i appreciate your help and time, its really helpful and life saving. You are rock!!

pri1222210

10/10/2016 10:37:03 PM

It is implemented in the delegation design pattern. But I have to give reference with which 2 design pattern it can be implemented. For this I describe the observer and command design patterns. What is the purpose of the Clone Interface? Whereby the Company class implements cloneable interface. For what purpose is the clone used for? Because the actual object remains as it is and the clone of the object can be created and all the operation can be performed on it. Another question, could you explain why the output for Tumbleweed Co for all the years the bank balances are zero ($0.00), and also statistics of unnamed buyer for all years is $0.00?

pri1222210

10/10/2016 10:36:36 PM

the relationship between Company class and CompanyList class is a many to many association right? meaning both these classes refer or use each other Under the Company.java file, under CompanyList class (line 210) // if (c.getYears().get(i) !=null){ why do you have that in commented? then you have a print statement which is not under comments. Any purpose for that? Please assist. Thank youAlso the lines, 211, 405, and 516 under the CompanyList class line 211: System.out.println("Year: " + i + " Bank Balance : $"+ df.format(c.getYears().get(i).getBankBalance()>0 ? c.getYears().get(i).getBankBalance()*1.05 : 0)); line 405: c.setBankBalance(c.getBankBalance()> 0? c.getBankBalance()*1.05 : 0); line 516: c.setBankBalance(c.getBankBalance()> 0? c.getBankBalance()*1.05 : 0); What is the purpose of the question mark "?" and the colon ":" in these statements? Another question, as previously... This application uses delegation, observer and command design patterns right? or just uses one design pattern - delegation design pattern?

pri1222210

10/10/2016 10:36:26 PM

It is a small application and it is not possible to provide the MVC architecture..but somehow it contains the model, view and controller as the separate as the class I provided contains the separate classes as business unit and company as the model ,main method provides the view functionality and for controller separate methods are provided for the processing of the three files.

pri1222210

10/10/2016 10:35:23 PM

I have mentioned other patterns also in attached document. Observer design pattern Delegation design pattern Command design pattern I have mentioned all the three.is it possible if you can break the system into MVC (model, view and controller) and be able to run? To enable separation of concerns in this program

pri1222210

10/10/2016 10:35:00 PM

The same will be run..Just keep the file in different folder and try to run once again... Please let us know if you have any further query.Also, in the report provided, its specified delegation design pattern is used. 1)Are there any other patterns used? 2)what is the other name for delegation pattern in OO? I mean in the company.docx, you have specified in the question (c) Where have you used polymorphism, and why? Discuss any design patterns you’ve used that incorporate polymorphism ans: In the current impementation of the code, Delegation design pattern is used as whenever any event or plan are happened, the company object stored the reference of the BussinessUnit instance so whenever the method of Company object is called, the call is automatically delegated to the corresponding method of the BusinessUnit Instance. 1)Are there any other design patterns used apart from delegation pattern? 2)what is the other name for delegation pattern in Object Orientation?

pri1222210

10/10/2016 10:34:06 PM

If i wanted to run on a unix machine, that is without the netbeans IDE or eclipse. Instead using terminal and command line arguments, how would that work then? It will work similarly. The following command s have to run. Javac CompanyList.java property.txt events.txt plan.txt Java CompanyList

pri1222210

10/10/2016 10:33:25 PM

yes i am running the command where i saved the file, that is i am on the directory that contains the file and compiling. Note: If i compile using javac Company.java, it does compile. But if i compile as: $ javac CompanyList.java property.txt events.txt plan.txt 2017 2020 javac: file not found: CompanyList.java Usage: javac use -help for a list of possible options

pri1222210

10/10/2016 10:32:59 PM

ignore the first one, this is the one: $ javac CompanyList property.txt events.txt plan.txt 2017 2020 javac: invalid flag: 2017 Usage: javac use -help for a list of possible options

pri1222210

10/10/2016 10:32:40 PM

you have specified that to run the program If Using commmand line - javac CompanyList property.txt events.txt plan.txt 2017 2020 In this case what should i use for CompanyList? or should i run it as it is? well, i am using cygwin as the terminal for compiling and running java programs, i am compiling the program using the screenshot provided in the docx, it does not compile. It shows me this error: javac: invalid flag: 2017 Usage: javac use -help for a list of possible options

len1222210

9/27/2016 6:57:02 AM

Fully implemented in java, also be able to compile and run in unix machine Submit your entire assignment electronically, via Blackboard, before the deadline. Submit one .zip or .tar.gz file containing: A declaration of originality – whether scanned or photographed or filled-in electron- ically, but in any case complete. Your source code – a set of ordinary .java, .py or .cpp/.h files. Your UML – one or more .pdf, .png or .jpg files. Everything else – exactly one .pdf file. You are responsible for ensuring that your submission is correct and not corrupted. You may make multiple submissions, but only your newest submission will be marked. The late submission policy (see the Unit Outline) will be strictly enforced.

Write a Review

JAVA Programming Questions & Answers

  Rebalancing a binary search tree

Your task is to write a class RebalancingTree that extends the attached BST class. You should override the insert method in BST. Your overriding method should first call the method it is overriding

  Determining the taylor series

Suppose that you are told that the Taylor series of f(x)=x3ex^3 about x = 0 is x3+x6+(x9/2!)+(x12/3!)+(x15/4!)+...

  Constructor that accepts a file name as its argument

Write a class with a constructor that accepts a file name as its argument. Assume the file contains a series of numbers, each written on a separate line. The class should read the contents of the file into an array, and then displays the following..

  Program with backtracking removing all gotos

Please fix the below program with backtracking removing all gotos  and also run the program before posting it and please comment before each line or explain such as what this line means or does .

  Construct a bulls and cows program for my intro java class

construct a Bulls and Cows program for my intro Java class. This program needs to perform the basic functions of the game (determining how many cows there are and how many bulls there are and tell the player when they win), but it also needs to offer..

  Create a whole different set of variables

I am asked to generate a set of INPUT TEST VALUES. Is that included into this control structure, or do I have to create a whole different set of variables?

  Task 1 create a new project in eclipsecreate a package

task 1 create a new project in eclipse.create a package called lsquopeople within this project. download the start up

  Consider the following conditions

Consider the following conditions: An enqueuer waiting on a full-queue or a dequeuer waiting on an empty queue sleep indefinitely, unless woken up by another thread. A thread must send a signal ONLY when it adds an element to an empty queue or remove..

  Give an implementation of the queue adt using an array

Give an implementation of the Deque ADT using an array, so that each of the update methods run in O(1) time. Program has to be written in Java.

  Calculate the cross product of two numeric vectors function

Create a function that calculate the cross product of two numeric vectors Function Name: calcCrossProduct

  1obtaining the new script download and save the attached

1.obtaining the new script download and save the attached comment cgi mailer script form-mail.pl to your servers

  Ask user to enter a list of names

Write a program that ask a user to enter a list of names. When you finish, The program will show the total number of characters in all the names.

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