HW4.5

 1 public class Solution
 2 {
 3     public static void main(String[] args)
 4     {
 5         final double POUNDS_PER_KILOGRAM = 2.2;
 6
 7         System.out.println("Kilograms" + "\t" + "Pounds" + "\t" + "Pounds" + "\t" + "Kilograms");
 8
 9         for(int i = 1, j = 20; i < 200 && j <= 515; i += 2, j += 5)
10             System.out.println(i + "\t" + i * POUNDS_PER_KILOGRAM + "\t" + j + "\t" + j * 1.0 / POUNDS_PER_KILOGRAM);
11     }
12 }
时间: 2024-08-26 16:54:11

HW4.5的相关文章

Stats 102A HW4

Stats 102A HW4 Due March 3, 2020General Notes• You will submit a minimum of three files, the core files must conform to the followingnaming conventions (including capitalization and underscores). 123456789 is a placeholder,please replace these nine d

HW4.30

1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the balance amount: "); 10 double balance = input.nextDouble(); 11 Syste

HW4.28

1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the year: "); 10 int year = input.nextInt(); 11 System.out.print("E

HW4.1

1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter an int value, the program exits if the input is 0: "); 10 int inputValue

HW4.3

1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 final double POUND_PER_KILOGRAM = 2.2; 6 7 System.out.println("KILOGRAM" + "\t" + "POUND"); 8 for(int i = 1; i < 200; i += 2) 9 System.out.println(

HW4.32

1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 System.out.print("Enter your lottery pick (two digits): "); 9 int guess = input.nextInt(); 10 11 i

HW4.31

1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the balance: "); 10 double balance = input.nextDouble(); 11 System.out.p

HW4.19

1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 for(int i = 1; i <= 8; i++) 6 { 7 for(int j = 8 - i; j > 0; j--) 8 System.out.print(" "); 9 for(int j = 1; j <= i; j++) 10 System.out.print((int)(Math.pow(2, j -

HW4.6

1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 final double MILES_PER_KILOGRAM = 1.609; 6 7 System.out.println("Miles" + "\t" + "Kilograms" + "\t" + "Kilograms" + "\t"

HW4.2

1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 int correctCount = 0; 9 int answer = 0; 10 int number1; 11 int number2; 12 13 long startTime = System.c