p2.Fall2005

p2.Fall2005 - Program #2 COP 2521_706 Fall 2005 Objectives:...

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

View Full Document Right Arrow Icon
Program #2 COP 2521_706 Fall 2005 Objectives: Gain experience using several arithmetic operators Gain experience with interactive programming (prompts and replies) Gain exposure to BufferedReader class and parseInt and parseFloat classes Gain experience to importing packages and classes Gaining experience in writing a Java program from scratch Functionality: Write a Java application that computes the number of miles per gallon (mpg) of gas for a trip. You are to use two computational approaches: one with miles per gallon and the other using the metric system, kilometers per liter. Accept (via prompts) a floating point number that represents the total amount of gas used. Also accept two integers representing the odometer readings at the start and end of the trip. Your prompts must include the format of the data which you are expecting to receive. That is, your prompt should say ‘something’ like Enter your gas consumed in the format n.n. Enter your starting odometer reading in miles (integer). Enter your ending odometer
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

p2.Fall2005 - Program #2 COP 2521_706 Fall 2005 Objectives:...

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