Define a method printFeetInchShort, with int parameters numFeet and numinches, that prints using and shorthand. End with a newline. Ex: printFeetInchShort(5, 8) prints: 5' 8" Hint: Use \" to print a double quote. 4227842543518.qx3zqy7 1 import java.util.Scanner; 2 3 public class Height Printer ( 4 5 6 7 8 9 10 11 12 13. 14 15 16 17 18} public static void main (String [] args) { new Scanner(System.in); } Scanner scnr int userFeet; int userInches; userFeet scnr.nextInt (); user Inches scnr.nextInt (); printFeet Inchshort (userFeet, userInches); // will be run with (5, 8), then (4, 11) 1 test passed All tests passed

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
CTU Class Homepage.
zy Section 4.1 - CS 226T: Java Progra X
✰ learn.zybooks.com/zybook/CS226-2204A-03-2204A/chapter/4/section/1
=zyBooks My library > CS 226T: Java Programming home > 4.1: User-defined method basics
CHALLENGE
ACTIVITY
5' 8"
Hint: Use \" to print a double quote.
422784.2543518.qx3zqy7
Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using' and " shorthand. End with a
newline. Ex: printFeetInchShort(5, 8) prints:
Thank you. Your reservation is co X
ART
1 import java.util.Scanner;
2
5
6
7
3 public class HeightPrinter {
4
8
9
4.1.3: Method call with parameter: Printing formatted measurement.
10
11
12
13
14
15
16
17
18}
Run
}
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
Print - Your Confirmed Reservatic X
int userFeet;
int userInches;
b Success Confirmation of Questic X
userFeet = scnr.nextInt ();
userInches = scnr.nextInt();
printFeet InchShort (userFeet, userInches); // will be run with (5, 8), then (4, 11)
Failed to compile
Height Printer.java:5: error: <identifier> expected
numFeet = numInches;
zyBooks catalog
1 test
passed
All tests
passed
? Help/FAQ
Stacey Queen
X
:
6:17 AM
8/30/2022
Transcribed Image Text:CTU Class Homepage. zy Section 4.1 - CS 226T: Java Progra X ✰ learn.zybooks.com/zybook/CS226-2204A-03-2204A/chapter/4/section/1 =zyBooks My library > CS 226T: Java Programming home > 4.1: User-defined method basics CHALLENGE ACTIVITY 5' 8" Hint: Use \" to print a double quote. 422784.2543518.qx3zqy7 Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using' and " shorthand. End with a newline. Ex: printFeetInchShort(5, 8) prints: Thank you. Your reservation is co X ART 1 import java.util.Scanner; 2 5 6 7 3 public class HeightPrinter { 4 8 9 4.1.3: Method call with parameter: Printing formatted measurement. 10 11 12 13 14 15 16 17 18} Run } public static void main (String [] args) { Scanner scnr = new Scanner(System.in); Print - Your Confirmed Reservatic X int userFeet; int userInches; b Success Confirmation of Questic X userFeet = scnr.nextInt (); userInches = scnr.nextInt(); printFeet InchShort (userFeet, userInches); // will be run with (5, 8), then (4, 11) Failed to compile Height Printer.java:5: error: <identifier> expected numFeet = numInches; zyBooks catalog 1 test passed All tests passed ? Help/FAQ Stacey Queen X : 6:17 AM 8/30/2022
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT