hi everyone. im currently working on a project where my scenario is that a company hired me to make programe for their company. what i need in my programe is

I. Add/Update customers

II. Add/Update products

III. Add/Update salesman
 
IV. Make transactions: Many products are sold to customers by salesman in one
visit. Transactions for each product with its quantity is recorded in
transaction_product.dat file and the receipt no is recorded in transaction.dat
file. It is important to note who sold the products. Salespersons bring the
manual receipt to data entry officers and they enter the data into the system.

V. Generate report: Mangers want to see the total products sold by the end of
each month. Report must show all the subtotals of all the products sold. The
total sale should also be shown.

i am done with step 1 2 n 3 but im stuck with 4. can anyone suggest or help me out with it.i am posting my project with a external link as i was unable to upload it here. it also include what i have done so far for part 4.i only need help with part 4.once im done with that part 5 should br easy. thanking in advance.


heres the line to the proj

http://www.megaupload.com/?d=QLTSLZVR

Make transactions: Many products are sold to customers by salesman in one
visit. Transactions for each product with its quantity is recorded in
transaction_product.dat file and the receipt no is recorded in transaction.dat
file. It is important to note who sold the products. Salespersons bring the
manual receipt to data entry officers and they enter the data into the system.

I assume that you have objects for the above parts (I,II,III)
Let's say that you have an Object like this:

class Transaction {
  private Procuct prod = null; // the product sold
  private int quantity = 0; // the number of items sold
  private Customer cust = null; // to whom it was sold
  private Salesman salesMan = null; // the salesman the made the sale
}

How do you want to save the object. One easy way for that would be to use the Serialzable interface. Have you been told a specific way to make the save?

Also I don't understand what needs to be saved to each file. Personally, I would have one file with objects like the one above.

Maybe in the transaction_product.dat you must save the above and at the
transaction.dat file the total price of all the transactions.

For example, if One Salesman, sold 2 prodA products and 3 prodB products to one customer, then maybe you must save the total value as well some id of that sale.

class Transaction {
  private int id = 0;
  private Procuct prod = null; // the product sold
  private int quantity = 0; // the number of items sold
  private Customer cust = null; // to whom it was sold
  private Salesman salesMan = null; // the salesman the made the sale

  public Transaction(int id) {
    this.id = id;
  }
}

// same Salesman, same customer:
Transaction tr1 = new Transaction(1); // set the values>2 items of ProdA
Transaction tr2 = new Transaction(1); // set the values>3 items of ProdB

Receipt rec = new Receipt();
// set the id=1
// calculate the total price of the tr1, tr2

// save the rec to transaction.dat
// save the tr1,tr2 to transaction_product.dat

// when the files would be read you will use the id to connect them
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.