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");
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");
Related questions
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");
}](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F6c8c0b50-0071-4d6d-a243-3744b45fe806%2F601d315a-3b6b-4b6d-a84d-5d829472249c%2Flzvzsh_processed.png&w=3840&q=75)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
