Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics 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 .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2005, 08:26 AM
Registered User
Join Date: Nov 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Java assignment

I need help creating a java program, please help im stuck

2. Write a program which will:
• prompt for and read in from the keyboard the current price of a litre of petrol; and
• calculate and display the corresponding price of a gallon of petrol (1 gallon = 4.55 litres);
• prompt for and read in the total cost of filling a car with petrol; and
• calculate and display the number of gallons required ; [Hint: Divide the cost by the price per gallon; if the car takes £22 worth of petrol and petrol is £4 per gallon then that gives 5.5 gallons]
• prompt for and display the number of miles covered since the previous fill; and
• calculate and display the average petrol consumption in miles per gallon; [Hint: Divide the mileage by the number of gallons]

You must use the conversion 1 gallon = 4.55 litres within your program; any other conversion factor used will be penalised.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me out with this assignment... vaidehi BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 3 September 10th, 2008 03:57 PM
Illegal Assignment Broodmdh Classic ASP Basics 2 August 22nd, 2008 06:21 AM
assignment pooja85jain SQL Language 1 September 2nd, 2006 11:09 AM
Java assignment greeny Java Basics 0 November 29th, 2005 08:29 AM
Definite Assignment Ibn_Aziz C# 0 December 21st, 2003 04:03 PM

All times are GMT -4. The time now is 07:53 PM.

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