1
import java.util.Scanner; public class KgToPound { public static void main(String[] args) { // Create a Scanner Scanner input = new Scanner(System.in); System.out.printf("%-20s%-20s\n", "Killograms", "Pounds"); int killograms = 1; double pounds = (2.2)*killograms; while (killograms < 20) { System.out.printf("%-20d%-20.1f\n", killograms, pounds); killograms=killograms+2; pounds = (2.2)*killograms; } } }

Problem 3

  • Upload
    brock

  • View
    215

  • Download
    2

Embed Size (px)

DESCRIPTION

wut up

Citation preview

Page 1: Problem 3

import java.util.Scanner;public class KgToPound {

public static void main(String[] args) {// Create a ScannerScanner input = new Scanner(System.in);System.out.printf("%-20s%-20s\n", "Killograms", "Pounds");

int killograms = 1;double pounds = (2.2)*killograms;while (killograms < 20) {

System.out.printf("%-20d%-20.1f\n", killograms, pounds);killograms=killograms+2;pounds = (2.2)*killograms;

}

}}