1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
prisoha [69]
3 years ago
12

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 en

ds with the letter y.
Computers and Technology
1 answer:
zimovet [89]3 years ago
5 0

Answer:

import java.util.Scanner;

public class WordProperties

{

public static void main(String[] args)

{

Scanner in = new Scanner(System.in);

System.out.print("Enter a word: ");

String word = in.next();

 

//check if it is short (fewer than 5 letters).

if (word.length()<5)

{

System.out.println(word + " is short");

}

 

//check if it is long (at least 10 letters).

if (word.length()>=10)

{

System.out.println(word + " is long");

}

 

//check if it ends with the letter y

if (word.charAt(word.length()-1)=='y')

{

System.out.println(word + " ends in a y");

}

}

}

Explanation:

You might be interested in
Discuss different types of data?[At the language of computer information and technology system]
Artist 52 [7]

Answer:

n computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integernumbers (of varying sizes), floating-point numbers (which approximate real numbers), characters and Booleans. A data type constrains the values that an expression, such as a variable or a function, might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type provides a set of values from which an expression(i.e. variable, function, etc.) may take its values.[1][2]

8 0
3 years ago
Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
ser-zykov [4K]

Answer:

a b c and d

Explanation:

edgunity 2020

7 0
3 years ago
Pass the two arrays to a method that will display the integer value(s), if any, that appear in both arrays (note that the two ar
vampirchik [111]

Answer:

The solution code is written in Java

  1.    public static void checkCommonValues(int arr1[], int arr2[]){
  2.        if(arr1.length < arr2.length){
  3.            for(int i = 0; i < arr1.length; i++){
  4.                for(int j = 0; j < arr2.length; j++){
  5.                    if(arr1[i] == arr2[j]){
  6.                        System.out.print(arr1[i] + " ");
  7.                    }
  8.                }
  9.            }
  10.        }
  11.        else{
  12.            for(int i = 0; i < arr2.length; i++){
  13.                for(int j = 0; j < arr1.length; j++){
  14.                    if(arr2[i] == arr1[j]){
  15.                        System.out.print(arr2[i] + " ");
  16.                    }
  17.                }
  18.            }
  19.        }
  20.    }

Explanation:

The key idea of this method is to repeated get a value from the shorter array to check against the all the values from a longer array. If any comparison result in True, the program shall display the integer.

Based on this idea, an if-else condition is defined (Line 2). Outer loop will traverse through the shorter array (Line 3, 12) and the inner loop will traverse the longer array (Line 4, 13). Within the inner loop, there is another if condition to check if the current value is equal to any value in the longer array, if so, print the common value (Line 5-7, 14-16).

5 0
3 years ago
Look at the color key below the map that shows the overall performance range. What is the range for 1 Year Performance? How does
swat32

A performance range simply means the threshold and maximum percentage of shares that may become earned.

<h3>What is a performance range?</h3>

Your information is incomplete. Therefore, an overview will be given. A performance range is the maximum percentage if shares that may become earned shares due to the attainment of the requirements of the performance.

It should be noted that in this case, the opportunity to incentivize performance will be associated with the relative performance.

Learn more about performance on:

brainly.com/question/26256535

5 0
2 years ago
What is the answer to this question I am not sure?
aleksley [76]

Answer:

Light sensor

Explanation:

“Street Light that Glows on Detecting Vehicle Movement. Generally, street light controlling system is a simple concept which uses a transistor to turn ON in the night time and turn OFF during the day time. The entire process can be done by a using a sensor namely LDR (light dependent resistor).”

8 0
3 years ago
Read 2 more answers
Other questions:
  • Open a command prompt on PC1. Issue the command to display the IPv6 settings. Based on the output, would you expect PC1 to be ab
    7·1 answer
  • What is 1-7? Plz help!!!
    15·1 answer
  • This graph shows both a reflection and a
    14·2 answers
  • Can anyone please help with this programming code in python num= 7 if num &gt; 3: print(“3”) if num &lt; 5: print(“5”) if num ==
    6·1 answer
  • How will Mario know which words are misspelled in his document?
    11·2 answers
  • Switched backbone networks:_____.a. always use a ring topology.b. require much more management that do routed backbone networks.
    10·1 answer
  • Develop a C program that calculates the final score and the average score for a student from his/her (1)class participation, (2)
    9·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • • R7.9 Write enhanced for loops for the following tasks.
    13·1 answer
  • Determine the value of a and b at the end of the following code segment:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!