import java.util.Scanner; public class Lab6d { public static void main(String[]
ID: 3941527 • Letter: I
Question
import java.util.Scanner;
public class Lab6d {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
// TODO: get user choice
// TODO: call printTable method passing choice as the parameter
}
public static void printTable(int stop) {
// TODO: print header
// TODO: loop to print table rows up to stop value
}
Explanation / Answer
import java.util.Scanner;
public class Lab6d {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
System.out.println("enter integer between 1 and 30 : ");
int n=scnr.nextInt();
printTable(n);
}
public static void printTable(int stop) {
System.out.println("Pound Kilograms");
for(int i=1;i<=n;i++)
{
System.out.println(i+" "+i*0.45);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.