p1.COP2551.Spring2010

p1.COP2551.Spring2010 - Program#1 COP 2551 Spring 2010 Due...

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

View Full Document Right Arrow Icon
Program #1 COP 2551 Spring 2010 Due 21 January 2010 by start of class (4:30pm) Objectives: Gain experience using several arithmetic operators Gain experience with interactive programming (prompts and replies) Gain exposure to Scanner class and its methods. Gain experience to importing packages and classes Gaining experience in writing a Java program from scratch Specifications: 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 appropriate prompts using Scanner objects) a floating point number that represents the total amount of gas used. Also accept in separate prompts two integers representing the odometer readings at the start and end of the trip. (Three overall prompts). 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
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.

This note was uploaded on 07/26/2011 for the course COP 2551 taught by Professor Roggio,r during the Summer '08 term at UNF.

Page1 / 2

p1.COP2551.Spring2010 - Program#1 COP 2551 Spring 2010 Due...

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