Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2005, 08:29 AM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Java assignment

I need help with a java program, i dont have a clue how to do it, any help would be appreciated gr8ly

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
Reply


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 JSP Basics 0 November 29th, 2005 08:26 AM
Definite Assignment Ibn_Aziz C# 0 December 21st, 2003 04:03 PM



All times are GMT -4. The time now is 03:24 PM.


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