Write a program that reads a word and prints whether it is short (fewer than 5 letters). it is long (at least 10 letters). it ends with the letter y. book-bilo-2-ch03-sec02-cc-1 worarroperues.java 1 import java.util.Scanner; 2 3 public class WordProperties 4 ( 5 6 7 8 9 10 11 12 13 14 15 16 ASANNAZAR 17 18 19 20 21 22 23 24 public static void main(String[] args) ( Scanner in = new Scanner(System.in); System.out.print("Enter a word: "); String word = in.next(); if (word < 5 { System.out.println(word + " is short"); } if (word < "10") { System.out.println(word + " is long"); if { (word.substring(word.length()-1).equals("y")) System.out.println(word + "ends in a y");

Question

show output of code 

Write a program that reads a word and prints whether
o it is short (fewer than 5 letters).
it is long (at least 10 letters).
o it ends with the letter y.
book-bilo-2-ch03-sec02-cc-1
worarroperties.java
1 import java.util.Scanner;
2
3 public class WordProperties
4 (
5
6
7
8
9
10
ENNESASKA
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26)
public static void main(String[] args)
{
}
Scanner in = new Scanner(System.in);
System.out.print("Enter a word: ");
String word = in.next();
if (word < 5
{
System.out.println (word + " is short");
}
if ( word <= "10")
{
System.out.println (word + " is long");
}
if (word.substring(word.length() 1).equals("y"))
{
System.out.println(word + "ends in a y");
}
Transcribed Image Text:Write a program that reads a word and prints whether o it is short (fewer than 5 letters). it is long (at least 10 letters). o it ends with the letter y. book-bilo-2-ch03-sec02-cc-1 worarroperties.java 1 import java.util.Scanner; 2 3 public class WordProperties 4 ( 5 6 7 8 9 10 ENNESASKA 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26) public static void main(String[] args) { } Scanner in = new Scanner(System.in); System.out.print("Enter a word: "); String word = in.next(); if (word < 5 { System.out.println (word + " is short"); } if ( word <= "10") { System.out.println (word + " is long"); } if (word.substring(word.length() 1).equals("y")) { System.out.println(word + "ends in a y"); }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer