Question: Read four strings from input and call printCapital ( ) twice: once with the first and third inputs as arguments, and again with the second

Read four strings from input and call printCapital() twice: once with the first and third inputs as arguments, and again with the second and fourth inputs as arguments. public class Capital { System.out.println(capital_name +" is "+ region_name +"'s capital.");public static void main(String[] args){/* Your code goes here */}
Ex: If the input is Montgomery Jakarta Alabama Indonesia, then the output is:
Montgomery is Alabama's capital.
Jakarta is Indonesia's capital.
Read four strings from input and call

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!