Marathon

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Marathon as PDF for free.

More details

  • Words: 143
  • Pages: 1
Marathon /* * Marathon program (filename Marathon.java) * Created by 1,000_naymes for ICT 352 * Program informs a user of the distance of a marathon (26 miles, 385 yards) in * miles and kilometers. */ import java.util.Scanner; public class Marathon { public static void main( String[] args ) { // declaring & initiating variables String OutputMessage; double distanceMiles, distanceKilometers; // welcome message System.out.print("The distance of a marathon is 26 miles and 385 yards. \n\n This program will convert the distance to miles and kilometers. \n \n"); distanceMiles = (( 26 * 1760.00 ) + 385) / 1760.00; distanceKilometers = ( 1.609344 * 26 ) + ((385 / 1760) * 1.609344); OutputMessage = "The exact distance of a marathon in miles is " + distanceMiles + "\n" + "The exact distance in kilometers is " + distanceKilometers; System.out.println( OutputMessage ); } }

Page 1

Related Documents

Marathon
November 2019 22
Marathon
October 2019 24
Marathon
November 2019 20
Marathon Pdf
November 2019 13
Stockholm Marathon
May 2020 5
Reglement Marathon
November 2019 9