import java.util.Scanner;
public class party
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String[] w = { "Mamata Banerjee", "Kanshi Ram", "Syama Prasad Mukherjee","Jyoti Basu","P. A. Sangma","Sharad Pawar","Arvind Kejriwal","Debabrata Biswas","Asaduddin Owaisi","N. Rangaswamy"};
String[] l = { "AITC", "BSP", "BJP","CPI","NPP","NCP","AAP","AIFB","AIMIM","AINRC"};
System.out.print("Enter name of the party: ");
String ch = sc.next();
int index = -1;
for (int i = 0; i < l.length; i++)
{
if (l[i].equals(ch))
{
index = i;
}
}
if (index != -1)
{
System.out.println(l[index] + " - " + w[index]);
}
else
{
System.out.println("Sorry Not Found!");
}
}
}
public class party
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String[] w = { "Mamata Banerjee", "Kanshi Ram", "Syama Prasad Mukherjee","Jyoti Basu","P. A. Sangma","Sharad Pawar","Arvind Kejriwal","Debabrata Biswas","Asaduddin Owaisi","N. Rangaswamy"};
String[] l = { "AITC", "BSP", "BJP","CPI","NPP","NCP","AAP","AIFB","AIMIM","AINRC"};
System.out.print("Enter name of the party: ");
String ch = sc.next();
int index = -1;
for (int i = 0; i < l.length; i++)
{
if (l[i].equals(ch))
{
index = i;
}
}
if (index != -1)
{
System.out.println(l[index] + " - " + w[index]);
}
else
{
System.out.println("Sorry Not Found!");
}
}
}
Output:
Enter name of the party: BJP
BJP - Syama Prasad Mukherjee
Enter name of the party: AAA
Sorry Not Found!
Sir it free or paid course is available
ReplyDelete