Wrox Programmer Forums
|
BOOK: Beginning Java 2, JDK 5 Edition
This is the forum to discuss the Wrox book Ivor Horton's Beginning Java 2, JDK 5 Edition by Ivor Horton; ISBN: 9780764568749
Welcome to the p2p.wrox.com Forums.

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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2012, 01:22 PM
Registered User
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default java

how do i Write a java program that does the following:

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
To call a java class from javascipt and pass a variable to the java servelet too prithagupta Java Basics 4 March 9th, 2013 08:39 AM
java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java Hot Nixxxter Java Basics 6 January 11th, 2012 12:36 PM
Java SE Development Kit and Eclipse IDE for Java EE? Droider BOOK: Beginning Android Application Development 1 October 7th, 2011 08:42 AM
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.