Question: zyBooks Java word number. A user types a word and a number on a single line. Read them into the provided variables. Then print: word_number.
zyBooks Java word number.
A user types a word and a number on a single line. Read them into the provided variables. Then print: word_number. End with newline. Example output if user entered: Amy 5 1 inport java.util.scanner; 3 public class SpaceReplace t 4 public static void main (Strine t ares) new Scanner(System.in); t Scanner scnr String userard int usertJun- System.out.printEnter word:); userNordscnr.next); System.out.print Enter number: "); userNumscnr.next) word nunber(userworduserlum); System.out.print(word number); 19 12 13 14 16 17 18 returni Run Failed to compile SpaceReplace.java 12: error incompatible types: String cannot be converted to int userNum = scnr. next () ; SpaceReplace.java 13: error: cannot find symbol word number- (userWord + userNum); symbol: variable word_number location: class SpaceReplace SpaceReplace.java 14 error cannot find symbol System.out-print (word_number)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
