/*Write the Java source code necessary to build a solution for the following problem:
Changes in the economy have determined that for the EZ shipping company, a surcharge will be assessed on all packages that meet certain criteria. The surcharge is a function of the characteristics of the package and the zip code to which it is sent.
If the first digit of the zip code is a "4," then there is an additional surcharge of 5% on the shipping cost. If the first digit of the zip code is a "6," then there is an additional shipping cost surcharge of 9% based on the weight of the package. For all other zip codes there is an additional shipping cost surcharge of 14%. Additionally, if the zip code is even, then there is an additional charge of 2% of the shipping cost.
In addition to the surcharges, the regular charges for shipping are calculated as follows:
For all weights under five pounds, the charge is $12.00.
For weights over five pounds, the charge is calculated as follows:
If length * width * height + weight is:
a. Between 5.1 and 15, the charge is 14.00
b. Between 15. 1 and 34, the charge is 17.00
c. Between 34. 1 and 45, the charge is 21.00
d. Between 45.1 and 60, the charge is 33.00
e. Greater than 60, the charge is 105.00
Write a program that allows the user to input the zip code and the characteristics of the package then prints out the following:
The zip code and dimensions of the package
The shipping cost
The surcharge
The total shipping cost (shipping cost plus surcharge)
*/
import java.util.*;
public class shippingCharges{
public staticdouble dimLength=0, dimWidth=0, dimWeight=0;
public static Scanner stdIn = new Scanner(System.in);
public staticvoid main(String[]args){
System.out.println("Enter the height of the package :");
stdIn = dimLenght.nextDouble();
System.out.println("/nEnter the Width of the package :");
stdIn = dimWidth.nextDouble();
System.out.println("/nEnter the Weight of the package :");
stdIn = dimWeight.nextDouble();
}
public staticdouble calcShipping(double charge,double len,double wdth,double wght){
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.
/home/mv25Sr/prog.vb (29,7) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (29,19) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (32,30) : Error VBNC90019: Expected '('.
Error recovery not implemented yet.
/home/mv25Sr/prog.vb (32,30) : Error VBNC90019: Expected 'Of'.
Error recovery not implemented yet.
Error recovery not implemented yet.
/home/mv25Sr/prog.vb (32,30) : Error VBNC90019: Expected ')'.
Error recovery not implemented yet.
/home/mv25Sr/prog.vb (32,30) : Error VBNC30205: Expected end of statement.
Error recovery not implemented yet.
/home/mv25Sr/prog.vb (32,30) : Error VBNC90019: Expected 'End'.
Error recovery not implemented yet.
/home/mv25Sr/prog.vb (32,30) : Error VBNC30205: Expected end of statement.
Error recovery not implemented yet.
/home/mv25Sr/prog.vb (32,30) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (34,18) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (34,62) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (35,18) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (35,57) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (37,18) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (37,36) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (38,15) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (38,64) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (39,14) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (39,39) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (40,15) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (40,65) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (41,14) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (41,38) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (42,15) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (42,66) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (43,14) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (43,39) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (47,6) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (49,18) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (51,15) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (51,33) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (52,15) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (52,22) : Error VBNC30037: Symbol is not valid.
/home/mv25Sr/prog.vb (53,6) : Error VBNC30203: Not valid as identifier.
/home/mv25Sr/prog.vb (55,2) : Error VBNC30203: Not valid as identifier.
There were 35 errors and 0 warnings.
Compilation took 00:00:00.6456410