p1.COP2551.Summer2011

p1.COP2551.Summer2011 - Program #1 COP 2551 Summer 2011 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 – Summer 2011 Due Monday, 11 July 2011 – midnight (drop dead day/time: 12 July 2011 at midnight) 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 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 appropriate prompts) a floating point number (double) that represents the total amount of gas used, such as 14.6. Also accept two integers representing the odometer readings at the start and end of the trip, such as 32000 and 32768. Your prompts must include the
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

p1.COP2551.Summer2011 - Program #1 COP 2551 Summer 2011 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