Computation

Computation - import java.io.*; import java.text.*;...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; import java.text.*; /**Program #2 COP2551 Fall 2005 *Purpose: This program will compute the number of miles per gallon *(mpg)and kilometers per liter (km/l) of gas for a trip. The program will *accept (via prompts) a floating point number for the total amount of *gas used and two integers representing the odometer readings at the *start and end of the trip. The following information will be printed: *the original odometer reading in miles and kilometers, the final *odometer reading in miles and kilometers, the amount of fuel used in *gallons and liters, the mileage in miles per gallon and kilometers per *liter. *@author XXXXX XXXX *@version 1.4.2 */ public class Computation { //************************************************************** //Function: MAIN // Serves as the main driver for this program. // //Calls: None // //Called by: None // //Input Parameters: int originalReading, int finalReading, // float fuelUsed // //Returns: Nothing //************************************************************** /**Calculates mileage in miles per gallon and kilometers per liter
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Computation - import java.io.*; import java.text.*;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online