1)DEFINITION OF DATA REQUIREMENTS
Produce an itemised consigment note for each customer including
-dimension,weight and price per parcel.
-total weight and price consigment
-number of parcels
RESIDENT DATA
-up to 2kg-£7.50
-up to 4kg-£8.00
-up to 10kg-£8.55
-up to 12kg-£9.10
-up to 14kg-£9.70
-up to 16kg-£10.35
-for each extra 2kg,up to 30kg,add £0.90
USER INTERFACE DESIGN
itemised consigment note produced for each year.This reports contains information required as discussed above in the data requirements section.the customer data destination is shown clearly at the top,followed by details of all parcels and lastly summary information is printed.
CONSIGNMENT:1
CUSTOMER:A
DESTINATION:THE AVENUE,OUTMARKET,BIRMINGHAM
INSTRUCTION:AFTER6 PM
PARCEL LENGTH BREADTH HEIGHT WEIGHT COST
1 0m 0m 0m 2kg £7.50
2 1m 1m 0m 15kg £12.15
VALIDATION
the following checks will be carried out,and prevent the user from continuing if invalid data is enter.
- parcel length,breadth,height,weight must be numeric.
- parcel length must be > 0 and <=1.5m
- parcel breadth must be > 0 and <=1.5m
- parcel height must be > 0 and <=1.5m
- size pf parcel must be <=3m(length+breadth+height<=3m)
- parcel weight must be >=1kg and <=30kg
- weight of whole consignment must be <=200kg
examples validation codes
if parcellenght + parcelbreadth + parcelheight > 3 then
msgbox "There is a problem,the lenght.breadth and height cannot add up to more than 3m,otherwise the parcel cannot be sent"
end if
import javax.swing.JOptionPane;
import java.util.Scanner;
public class PackageService {
public static void main(String[] args) {
// Declare Variables
String accept, customerid, destination, instructions;
int consignment, parcelnum, cnt, totalweight=0;
double totalcost;
accept = JOptionPane.showInputDialog(null,"How Many Parcels To Send");
parcelnum = Integer.parseInt(accept);
int[] records;
records = new int[parcelnum];
int[] length;
length = new int[parcelnum];
int[] breadth;
breadth = new int[parcelnum];
int[] height;
height = new int[parcelnum];
int[] weight;
weight = new int[parcelnum];
double[] cost;
cost = new double[parcelnum];
accept = JOptionPane.showInputDialog(null,"What Is Consignment Number");
consignment = Integer.parseInt(accept);
customerid = JOptionPane.showInputDialog(null,"Enter Customer ID");
destination = JOptionPane.showInputDialog(null,"Enter Destination");
instructions = JOptionPane.showInputDialog(null,"Enter Instructions");
for(int i=0; i<parcelnum; i++)
{
cnt = i +1;
accept = JOptionPane.showInputDialog(null,"Enter Length of Parcel " +cnt);
length[i] = Integer.parseInt(accept);
accept = JOptionPane.showInputDialog(null,"Enter Breadth of Parcel " +cnt);
breadth[i] = Integer.parseInt(accept);
accept = JOptionPane.showInputDialog(null,"Enter Height of Parcel " +cnt);
height[i] = Integer.parseInt(accept);
accept = JOptionPane.showInputDialog(null,"Enter Weight of Parcel " +cnt);
weight[i] = Integer.parseInt(accept);
totalweight=totalweight + weight[i];
}
JOptionPane.showMessageDialog(null,"The Total Weight is " + totalweight);
System.exit(0);
}
}
have try the best i could but dont know why is not working on jcreator..kepping repeating mm