Code Development and Debugging

The code for Tic-tac-toe is attached as zip file tictactoe.zip in this document

Tic-tac-toe (or Noughts and crosses, Xs and Os) is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid.

The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonalrow wins the game.

Please do the following for the above code

1.Analyse the code and put appropriate comments as perAricent Coding guidelines for making it an understandable and maintainable.

2.Also introduce appropriate error handlings as required.

3.There are couple of bugs/fix required to makes it functional. After the fixes this should be playable between two players.

4.Develop unit test cases for testing this program.

Attempt the given project

  • Expected artifacts
  • Algorithm design/flow charts for each class – well documented code describing the system and individual class design is also acceptable in place flow charts & design documents
  • Java programs
  • Unit Test cases
  • Identify test areas that can be automated
  • Identify load conditions for performance testing.
  • Develop the code as per coding guidelines and make sure it is maintainable.
  • Identify unit test cases for the function implemented completely

The project spec is

  1. Car wash simulation

Car wash Simulation

Description: Carwash system is deployed at petrol pumps. The petrol pump station starts in the morning at 8:00 when the cars starts arriving and it stops at 8:00 in the evening. There are different washing station for small cars and big cars.

Operation at Petrol Pump:

  1. One petrol pump has three car wash setup - One for small cars and two for big cars. Small cars take 15 minutes for the wash and the big cars take about half an hour for its wash.
  2. The price charged for washing small car is 3/4 the price of big cars. The small cars can be washed at the big car station but the big cars do not fit in the small car stations.
  3. In addition the petrol pump owner has to spend money on the attendants and water consumption The water comsumption for the small cars are normally half the amount used by bug cars.
  4. Further since the small car station did not require much of attention for the washing, it was looked after by women attendants whereas the big car station was attended by men. The men attendants are paid 30% more than the women attendants.
  1. From the operation perspective, there was no issues in the morning hour when the rush used to be less and the entire washing station was able to serve the customers.
  2. Towards the afternoon the rush used to increase and invariably the rush for the small cars was much higher than the big cars.
  3. The pump owner realised that unless and until he uses the resources effectively and in the optimised way he is going to incur loss and hence needed to put an optimisation plan to maximise the revenues.
  4. Model this scenario programmatically in Java so that whenever a car arrives, based on the rush on the wash stations, these cars are allotted to specific wash stations. The algorithm need to implement the allocation of cars to the washing stations so that the cost incurred can be optimised.

Simulate the car entry by generating random numbers and increasing the frequency of generating random numbers for the small car and bug cars and print the results for allocation of cars and the cost incurred.