Question

In: Computer Science

Write a complete Java program pleaaase The transport Company in which you are the engineer responsible...

Write a complete Java program pleaaase

The transport Company in which you are the engineer responsible of operations for the optimization of the autonomous transport of liquid bulk goods, got a design contract for an automated intelligent transport management system that are autonomous trucks which transport liquid bulk goods (urea, dust suppressants, acids, gasoline, milk, etc.), forming part of customer orders.

After loading at a centralized distribution center, the trucks move autonomously to the delivery points. After loading at a centralized distribution center, the trucks move autonomously to the delivery points.

The management of this automated intelligent transport management system is based on the following entities:

1) Goods stored at the centralized distribution center (Trois-Rivières).

2) Autonomous trailer trucks (tanks)

3) Orders of goods transported by autonomous trucks

4) Customers

5) Freight transport routes

6) Destination cities (delivery cities)

From lists of goods ordered from customers, a clerk generates delivery routes that send autonomous trucks pre-loaded with liquid goods transported by tanker.

The characteristics of each entity are:

  • Merchandise:
    • Merchandise number
    • Description (ex: urea, dust suppressant, sodium hypochlorite, ethylene glycol, propylene glycol, acid, milk, etc.)
    • Volume in stock (liter)
    • example
    • Merchandise.dat
    • 1, acid, 350000
      2, urea, 1000000
      3, milk, 2000000
  • Trucks:
  • Truck number
  • Transport capacity (liter ex: 35,000, 25,000, 15,000, 10,000)
  • Autonomy Range (distance km)
  • example:
  • trucks.dat
  • 1, 35000, 600
    2, 10000, 1000
    3, 20000, 800
    4, 35000, 600
  • Orders :
  • Order number
  • Client number
  • Commodity Number
  • Volume (liter)
  • Delivery city
  • exemple;
  • orders.dat:
  • 1, 1, 1, 35000, Montreal
    2, 3, 2, 70000, Quebec
    3, 2, 3, 25000, La Pocatiere
    4, 4, 1, 105000, Repentigny
  • Clients :
  • Client number
  • City
  • Routes:
  • Trip number
  • Truck number
  • Number of different clients
  • Client number
  • Commodity number
  • Volume delivered
  • Delivery cities:
  • City number
  • Name

Stages of realization:

  1. Write the implementation of the classes Merchandise, Customers, Trucks, Orders, Cities and Trips: for each of the classes, we propose to define (first of all) the constructor of the class which makes it possible to load the existing data from Merchandise.dat, Customers.dat, Camions.dat, Orders.dat, Trajets.dat, Villes.dat files and at least one method for displaying the characteristics of a particular object from each of these classes.
  2. Write a main program (main method) which:
  • Allows you to add, delete, modify information, update data on disks (.dat files) on Goods, Customers, Trucks, Orders, Cities and Routes.
  • Allows you to display all the characteristics of the journeys made.

Also displays information about Merchandises, orders, customers, trucks, cities.

  • To do this you can use a menu in your main () function which allows you to select the operations (eg: additions, deletions, modifications, displays).

Your application must take into account the handling of errors (exceptions).

Solutions

Expert Solution

Here's my coode for the same,

import java.util.*

//Defining a class of all functionalities.

Public class transport{

    String Goods;

    String Customers;  

    String Trucks;

    String Orders;

   String Cities;

    String Routes;

Transport(String filename){//file-read operation

   

Scanner reader = new Scanner(new FileInputStream(filename);

  

 while (reader.hasNext()) {  //getting data    

    Goods = reader.next();

    Customers = reader.next();  

    Trucks = reader.next();

    Orders = reader.next();

   Cities = reader.next();

    Routes = reader.next();

    }

}

//Getters and setters

Public getGoods{

return Goods;

}

Public deleteGoods{

Goods = null;

}

Public setGoods(String a){

Goods = a;

}

Public getCustomers{

return Customers;

}

Public deleteCustomers{

Customers = null;

}

Public setCustomers(String b){

Customers = b;

}

Public getTrucks{

return Trucks;

}

Public deleteTrucks{

Trucks = null;

}

Public setTrucks(String c){

Trucks = c;

}

Public getOrders{

return orders;

}

Public deleteOrders{

Orders = null;

}

Public setOrders(String d){

Orders = d;

}

Public deleteOrders{

Orders = null;

}

Public getCities{

return Cities;

}

Public deleteCities{

Cities = null;

}

Public setCities(String e){

Cities = e;

}

Public getRoutes{

return Routes;

}

Public deleteRoutes{

Routes = null;

}

Public setRoutes(String f){

Routes = f;

}

public static void main(String[] args){//driver method
 
 Transport(file.txt)
 getRoutes;
 setRoutes(abc);
 
}

writeoperation{//save operation

try{    

           FileWriter fw=new FileWriter(filename);    

           fw.write(Goods + "," + Customers + "," + Trucks + "," + orders + "," + cities + "," + routes);    

           fw.close();    

          }

catch(Exception e){

System.out.println(e);

}    

                System.out.println("Success...");  

}

}


Related Solutions

Write a complete program in java that will do the following:
Write a complete program in java that will do the following:Sports:             Baseball, Basketball, Football, Hockey, Volleyball, WaterpoloPlayers:           9, 5, 11, 6, 6, 7Store the data in appropriate arraysProvide an output of sports and player numbers. See below:Baseball          9 players.Basketball       5 players.Football           11 players.Hockey            6 players.Volleyball        6 players.Waterpolo       7 players.Use Scanner to provide the number of friends you have for a team sport.Provide an output of suggested sports for your group of friends. If your...
Need in JAVA. You are to use Binary Trees to do this Program. Write a complete...
Need in JAVA. You are to use Binary Trees to do this Program. Write a complete program, which will process several sets of numbers: For each set of numbers you should: 1. Create a binary tree. 2. Print the tree using “inorder”, “preorder”, and “postorder”. 3. Call a method Count which counts the number of nodes in the tree. 4. Call a method Children which prints the number of children each node has. 5. Inset and delete several nodes according...
DO THIS IN JAVA Write a complete Java program. the program has two threads. One thread...
DO THIS IN JAVA Write a complete Java program. the program has two threads. One thread prints all capital letters 'A' to'Z'. The other thread prints all odd numbers from 1 to 21.
DO THIS PROGRAM IN JAVA Write a complete Java console based program following these steps: 1....
DO THIS PROGRAM IN JAVA Write a complete Java console based program following these steps: 1. Write an abstract Java class called Shape which has only one abstract method named getArea(); 2. Write a Java class called Rectangle which extends Shape and has two data membersnamed width and height.The Rectangle should have all get/set methods, the toString method, and implement the abstract method getArea()it gets from class Shape. 3. Write the driver code tat tests the classes and methods you...
URGENT!!! DO THIS PROGRAM IN JAVA Write a complete Java console based program following these steps:...
URGENT!!! DO THIS PROGRAM IN JAVA Write a complete Java console based program following these steps: 1. Write an abstract Java class called Shape which has only one abstract method named getArea(); 2. Write a Java class called Rectangle which extends Shape and has two data membersnamed width and height.The Rectangle should have all get/set methods, the toString method, and implement the abstract method getArea()it gets from class Shape. 3. Write the driver code tat tests the classes and methods...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user...
IN JAVA PROGRAMMING Write a complete Java program to do the following: a) Prompt the user to enter the name of the month he/she was born in (example: September). b) Prompt the user to enter his/her weight in pounds (example: 145.75). c) Prompt the user to enter his/her height in feet (example: 6.5). d) Display (print) a line of message on the screen that reads as follows: You were born in the month of September and weigh 145.75 lbs. and...
Write a complete Java program, including comments in each method and in the main program, to...
Write a complete Java program, including comments in each method and in the main program, to do the following: Outline: The main program will read in a group of three integer values which represent a student's SAT scores. The main program will call a method to determine if these three scores are all valid--valid means in the range from 200 to 800, including both end points, and is a multiple of 10 (ends in a 0). If the scores are...
Write a complete Java program, including comments in each method and in the main program, to...
Write a complete Java program, including comments in each method and in the main program, to do the following: Outline: The main program will read in a group of three int||eger values which represent a student's SAT scores. The main program will call a method to determine if these three scores are all valid--valid means in the range from 200 to 800, including both end points, and is a multiple of 10 (ends in a 0). If the scores are...
Write a complete Java program to print out the name bob
Write a complete Java program to print out the name bob
URGENT!! DO THIS CODE IN JAVA Write a complete Java FX program that displays a text...
URGENT!! DO THIS CODE IN JAVA Write a complete Java FX program that displays a text label and a button.When the program begins, the label displays a 0. Then each time the button is clicked, the number increases its value by 1; that is each time the user clicks the button the label displays 1,2,3,4............and so on.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT