You are currently viewing the BOOK: Beginning Java 2, JDK 5 Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .

A gasoline station charges 3.00 per gallon for regular, 4.50 per gallon for premium , 5.20 for diesel and 1.00 per Amp-Hr to charge an electric car(25 Amp-Hr to charge completely). In addition the station charges 12.00 for full service and 10.00 for quick and go service. There is no charge for self service. There is a 7.75% sales tax on the total gasoline purchase , 8% on the total diesel purchase, and 3% on the total for the electric car.
Your program should ask the customer whether he/she wants full service, quick and go, or self service. The type of fuel or charging should be asked for next. Then the amount of fuel or charge desired.
Your program should then calculate the bill specifying the type of service, type of fuel, amount of fuel/charge, the sales tax paid, and the final total.
A message of appreciation should be printed at the end.