Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Modify songVerse to play "The Name Game" (
OxfordDictionaries.com), by replacing "(Name)" with userName but without the first letter.
Ex: If userName = "Kaitlin" and songVerse = "Banana-fana fo-f(Name)!", the program prints:
Banana-fana fo-faitlin!
Ex: If userName = "Kaitlin" and songVerse = "Fee fi mo-m(Name)", the program prints:
Fee fi mo-maitlin
Note: You may assume songVerse will always contain the substring "(Name)".
Learn how our autograder works
54376438969320.32097
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); // Remove first character
songVerse = scnr . nextline();
// Modify songverse to replace (Name) with userName without first character
I* your solution goes here */
system.out.println(songverse);
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions