Ask Question

Assume that word is a String variable. Write a statement to display the message "Today's Word-Of-The-Day is: " followed by the value of word. The entire message, including the value of word, should appear on a single line of output. For example, if the value of word is "Hello", the statement should display the following: Today's Word-Of-The-Day is: Hello Hint: In your code make sure the string literal "Today's Word-Of-The-Day is: " is written exactly as shown here.

+2
Answers (1)
  1. 8 July, 21:51
    0
    import java. util. Scanner;

    public class TestClock {

    public static void main (String[] args) {

    Scanner in = new Scanner (System. in);

    System. out. println ("Enter a word for the day");

    String word = in. next ();

    System. out. println ("Today's Word-Of-The-Day is: "+word);

    }

    }

    Explanation:

    Use Scanner class to receive a user's value for the 'word' or

    Create a variable and save user's input

    Use string concatenation (plus operator) in the System. out. println To display the output as required by the question.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Assume that word is a String variable. Write a statement to display the message "Today's Word-Of-The-Day is: " followed by the value of ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers