Java Project Doha Appliances Repairs (DAR) Doha Appliances Repairs (DAR) is a re
ID: 3583623 • Letter: J
Question
Java Project
Doha Appliances Repairs (DAR)
Doha Appliances Repairs (DAR) is a repairs shop that serves its customers by providing maintenance services to their electronic appliances such as TVs, radios, washing machines, DVD players, playStations, ... etc. DAR keeps manual records of its customers’ data, their appliances and related services. This manual process is getting tedious as their customers base is becoming large. DAR believes that if they make a computerized information system, they can serve their customers far better than their competitors do. So they decided to use object-oriented technology to build a user-friendly system that can handle all I/O operations, save records permanently, and produce different reports when needed.
You are required to help DAR by building the system for managing their operations. The systems should keep track of customers, devices, spare parts, suppliers of parts, technicians (and their specialties), and details of the repair services they provide.
On arrival at the reception desk the customer will provide the receptionist (a technician) with details about the appliance and the required service, which is going to be filled in a job card with a brief description of the reported problem and results of the quick inspection by the receptionist. If the
appliance is brought for the first time a unique serial number is assigned to the appliance and printed on a sticker which is fixed on the top of the appliance. If the appliance already has a serial number it is noted and recorded in the job card. The system should be able to keep records of the job cards and the related services. An estimate date for finishing the repair service is recorded, and if the appliance is repaired before that date the customer is contacted in order to come and collect the appliance. The job card also contains details of the customer.
When an appliance is repaired, a description of what was done is recorded in the system. Also the details of the replaced parts and their cost is recorded, as well as the amount of labor cost for the job. The name of the technician who performed the repair is also recorded as part of the service record. Customers may contact DAR any time to follow-up the service progress and the system should help the technician to give the customer accurate feedback about the job status.
When the customer comes to collect his/her repaired appliance, the technician prints a report which contains details of the service and its cost. The customer takes this report to the cashier and pay the required amount. The cashier receives the payment whether in cash form or by credit card, and then stamps the report as ‘Paid’. He/she enters the paid amount and the form of payment. Credit card payments receive 5% discount. The customer then takes the stamped report and his/her payment receipt to the technician to receive his/her appliance.
Requirements
This is a team-project to develop the required system. The system must provide the following functionalities. Each class must be properly documented using the Javadoc tool.
1- Add a new person to the system (customer or technician or other related person).
2- Add a new appliance (if it is repaired before, the system should retrieve its details).
3- Add a new job card and fill it with all the needed details.
4- Add service details which is related to a specific job number.
5- Add payment related to a specific job.
6- Add inquiry about specific appliance/service. It should print: appliance details, service status,
and expected date to finish the service.
7- Add inquiry about customers.
8- Produce detailed tabular lists of all appliances and all customers.
9- Produce detailed tabular lists of all technicians and their specializations.
All methods created to meet the above requirements, their parameters and their returns-values must be documented using Javadoc comments. Your system should have GUI interface to interact with its users and should use files to save data permanently. All class attributes and constructors must be properly documented using Javadoc comments. Name of the person who created a class must be written as the author using Javadoc tool. Also add the date of creation of the class. The version number must also be included.
Each team should submit a group report. The group report is an MS-Word document containing a cover page that lists your names and QUID’s. The document should contain the source code of all the Java classes that you developed and screen shots of all input/output GUIs (filled with sample data for testing the system). If only a text user interface was implemented then please submit screen shots of the input/output dialogs. Also include in your document, all the HTML documents generated using Javadoc tool.
Each team member must submit an self-report. The self-report is one-page document describing his/her exact contribution to the project and explaining the advantages and disadvantages of working in teams, based on your current experience with the DAR project
Explanation / Answer
Answer:
import java.util.*;
public class TicTacToeGame
{
private int counter;
private char posn[]=new char[10];
private char player;
public static void main(String args[])
{
String ch;
TicTacToeGame Toe=new TicTacToeGame();
do{
Toe.beginBoard();
Toe.play_game();
System.out.println ("Would you like to play again (Enter 'Y')? ");
Scanner in =new Scanner(System.in);
ch=in.nextLine();
System.out.println("ch value is "+ch);
}while (ch.equals("Y"));
}
public void beginBoard()
{
char posndef[] = {'0','1', '2', '3', '4', '5', '6', '7', '8', '9'};
int i;
counter = 0;
player = 'X';
for (i=1; i<10; i++) posn[i]=posndef[i];
presentBoard();
}
public String presentBoard()
{
System.out.println( " " );
System.out.println( " " );
System.out.println( " " + posn [1] + " | " +posn [2]+ " | " +posn [3]);
System.out.println( " | | " );
System.out.println( " ___|____|___ " );
System.out.println( " " +posn [4]+ " | " +posn [5]+ " | " +posn [6]);
System.out.println( " | | " );
System.out.println( " ___|____|___ " );
System.out.println( " " +posn [7]+ " | " +posn [8]+ " | " +posn [9]);
System.out.println( " | | " );
System.out.println( " | | " );
System.out.println( " " );
return "presentBoard";
}
public void play_game()
{
int spot;
char blank = ' ';
System.out.println( "Player " + getPlayer() +" will go first and be the letter 'X'" );
do {
presentBoard();
System.out.println( " Player " + getPlayer() +" choose a posn." );
boolean posTaken = true;
while (posTaken) {
Scanner in =new Scanner (System.in);
spot=in.nextInt();
posTaken = checkPosn(spot);
if(posTaken==false)
posn[spot]=getPlayer();
}
System.out.println( "Nice move." );
presentBoard();
nextPlayer();
}while ( getWinner() == blank );
}
public char getWinner()
{
char Winner = ' ';
// Check if X wins
if (posn[1] == 'X' && posn[2] == 'X' && posn[3] == 'X') Winner = 'X';
if (posn[4] == 'X' && posn[5] == 'X' && posn[6] == 'X') Winner = 'X';
if (posn[7] == 'X' && posn[8] == 'X' && posn[9] == 'X') Winner = 'X';
if (posn[1] == 'X' && posn[4] == 'X' && posn[7] == 'X') Winner = 'X';
if (posn[2] == 'X' && posn[5] == 'X' && posn[8] == 'X') Winner = 'X';
if (posn[3] == 'X' && posn[6] == 'X' && posn[9] == 'X') Winner = 'X';
if (posn[1] == 'X' && posn[5] == 'X' && posn[9] == 'X') Winner = 'X';
if (posn[3] == 'X' && posn[5] == 'X' && posn[7] == 'X') Winner = 'X';
if (Winner == 'X' )
{System.out.println("Player1 wins the game." );
return Winner;
}
// Check if O wins
if (posn[1] == 'O' && posn[2] == 'O' && posn[3] == 'O') Winner = 'O';
if (posn[4] == 'O' && posn[5] == 'O' && posn[6] == 'O') Winner = 'O';
if (posn[7] == 'O' && posn[8] == 'O' && posn[9] == 'O') Winner = 'O';
if (posn[1] == 'O' && posn[4] == 'O' && posn[7] == 'O') Winner = 'O';
if (posn[2] == 'O' && posn[5] == 'O' && posn[8] == 'O') Winner = 'O';
if (posn[3] == 'O' && posn[6] == 'O' && posn[9] == 'O') Winner = 'O';
if (posn[1] == 'O' && posn[5] == 'O' && posn[9] == 'O') Winner = 'O';
if (posn[3] == 'O' && posn[5] == 'O' && posn[7] == 'O') Winner = 'O';
if (Winner == 'O' )
{
System.out.println( "Player2 wins the game." );
return Winner; }
for(int i=1;i<10;i++)
{
if(posn[i]=='X' || posn[i]=='O')
{
if(i==9)
{
char Draw='D';
System.out.println(" Game is stalemate ");
return Draw;
}
continue;
}
else
break;
}
return Winner;
}
public boolean checkPosn(int spot)
{
if (posn[spot] == 'X' || posn[spot] == 'O')
{
System.out.println("That posn is already taken, please choose another");
return true;
}
else {
return false;
}
// counter++;
}
public void nextPlayer()
{
if (player == 'X')
player = 'O';
else player = 'X';
}
public String getTitle()
{
return "Tic Tac Toe" ;
}
public char getPlayer()
{
return player;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.