Define a method printFeetInchShort, with parameters int numFeet and numInches, which prints using the abbreviation ‘ and “. End with a new line. Ex: printFeetInchShort(5, 8) displays: 5’ 8”
Answer
import java.util.Scanner;
public class HeightPrinter {
public static void printFeetInchShort(int numFeet, int numInches) {
System.out.println(numFeet + "' " + numInches + """);
}
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userFeet;
int userInches;
userFeet = scnr.nextInt();
userInches = scnr.nextInt();
printFeetInchShort(userFeet, userInches); // Will be run with (5, 8), then (4, 11)
}
}