Ask Question

Modify songVerse to play "The Name Game" (OxfordDictionaries), by replacing " (Name) " with userName but without the first letter. Ex: If userName

+4
Answers (1)
  1. 6 February, 08:45
    0
    The Java code for the problem is given below.

    Your solution goes here is replaced/modified by the statement in bold font below

    Explanation:

    import java. util. Scanner;

    public class NameSong {

    public static void main (String[] args) {

    Scanner scnr = new Scanner (System. in);

    String userName;

    String songVerse;

    userName = scnr. nextLine ();

    userName = userName. substring (1);

    songVerse = scnr. nextLine ();

    songVerse = songVerse. replace (" (Name) ", userName);

    System. out. println (songVerse);

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Modify songVerse to play "The Name Game" (OxfordDictionaries), by replacing " (Name) " with userName but without the first letter. Ex: If ...” 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