Question: Given string templateString on one line and string yearString on a second line, assign birthdayDate with a copy of templateString, where (year) is replaced with

Given string templateString on one line and string yearString on a second line, assign birthdayDate with a copy of templateString, where "(year)" is replaced with yearString. Ex: If the input is: Birthdate: 10-(year) 1993 then the output is: Birthdate: 10-1993 public class ReplaceField { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String templateString; String yearString; String birthdayDate; templateString = scnr.nextLine(); yearString = scnr.next(); /* Your code goes here */ System.out.println(birthdayDate); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!