-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathp2.java
More file actions
28 lines (25 loc) · 824 Bytes
/
p2.java
File metadata and controls
28 lines (25 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.*;
public class wonders
{
public static void main()
{
Scanner sc=new Scanner(System.in);
String wonders[]={"chicken itza", "christ the reedemer", "taj mahal", "great wall of china", "nachu pichu", "petre collesum"};
String locations[]={"MEXICO", "BRAZIL", "INDIA", "CHINA", "PERU", "JORDAN", "ITALY"};
System.out.println("Enter the country name");
String c=sc.next();
int flag=0;
int len=locations.length;
for(int i=0;i<len;i++)
{
if(c.equalsIgnoreCase(locations[i]))
{
flag=1;
System.out.println(locations[i]+"'s wonder is"+wonders[i]);
break;
}
}
if(flag==0)
System.out.println("Sorry not found");
}
}