Wrox Programmer Forums
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics 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 May 10th, 2012, 10:17 PM
Registered User
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Gas Station

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.

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