search for a name
Search for a name
Write a program to accept an array of names and a name and check whether the
name is present in the array. Return the count of occurrence. Use the following
array as input
{?Dave?, ?Ann?, ?George?, ?Sam?, ?Ted?, ?Gag?, ?Saj?, ?Agati?, ?Mary?, ?Sam?,
?Ayan?, ?Dev?, ?Kity?, ?Meery?, ?Smith?, ?Johnson?, ?Bill?, ?Williams?, ?Jones?,
?Brown?, ?Davis?, ?Miller?, ?Wilson?, ?Moore?, ?Taylor, ?Anderson?, ?Thomas?,
?Jackson?}
View Answers
May 26, 2011 at 11:51 PM
import java.io.*;
import java.util.StringTokenizer;
public class CountOccurance
{
public static void main(String args[])throws Exception
{
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
print("code sample");
System.out.println("ENTER ARRAY OF NAMES:");
String arrNames=br.readLine();
StringTokenizer st1=new StringTokenizer(arrNames);
System.out.println("ENTER THE NAME TO BE SEARCHED:");
String name=br.readLine();
int countNoOccurance=0;
while(st1.hasMoreTokens())
{
if(name.equalsIgnoreCase(st1.nextToken()))
{
countNoOccurance++;
}
}
System.out.println("THE NAME "+name+" HAS BEEN APPEARED "+countNoOccurance+" NO. OF TIMES");
}
}
*Sayem*
Ads
Related Tutorials/Questions & Answers:
search for a name
search for a name
Search for a
name
Write a program to accept an array of names and a
name and check whether the
name is present in the array. Return the count of occurrence. Use the following
array as input
{?Dave?, ?Ann
Advertisements
Name
Name make a program that take a input from user in alphabet and show all the
name of that character
E.g User give character "B".
The program shows all the human names which starts from B.
Java show all names
SEARCH
SEARCH how can we do
search in jsp...?
option for
search criteria like
name and DOB...
Please visit the following links:
http://www.roseindia.net/jsp/user-search.shtml
http://www.roseindia.net/servlets/search.shtml
search
search how to develop
search box and how to retrive data from database..
Please visit the following link:
Search box
Search
Search Hi,
I have a project in which I am trying to enter "Marathi" (Indian local language) data in JSP using JSTL and trying to
search data... and tries to
search then It shows no data from database
Name unique
Name unique I want to check whether the value which I give for the
name textfield already exists in the database. In case if it exists , it should.... In other words, value for the
name should be unique
class name
class name what is the class
name of circle.java
how do i complie my jdk file, what happen s if i put in the correct commands and it still does not complie, what do i do next
personal name aliases
personal
name aliases
name to enter.but
search in internet connection
Please visit the following links:
http://www.roseindia.net/servlets/search.shtml
http://www.roseindia.net/answers/viewqa/JSP
personal name aliases
personal
name aliases enter the
name search result in internet connection using java code
Please visit the following links:
http://www.roseindia.net/servlets/search.shtml
http://www.roseindia.net/answers/viewqa/JSP
SEARCH PAGE
SEARCH PAGE
search page:option for
search criteria like
name and DOB will be asked.on entering the detail,data matching
search criteria will be displayed..criteria can be both or any one of them..
can you send code
Search index
Search index how to write code for advanced
search button
search program
search program i m writing program which takes company names from databse...serch on google...n try to find the best match WEBSITE...of company
name....m confused....how can i find best match..between my company
name ..and all
Person have name field of Name type..??
Person have
name field of
Name type..?? Person have
name field of
Name type means i understood to create new
Name class with fields firstname...
name?
can you please write code two two different class and show me how to use
Hibernate Search
Hibernate Search Where to learn Hibernate
Search module?
Thanks
Hi,
Check the tutorial: Hibernate
Search - Complete tutorial on Hibernate
Search
Thanks
linear search
linear search write a program to find string using linear
search
sql query search function
sql query
search function i have a textbox on a form , i like a
search a data in the form, when i give whatever
name and id or etc..its will
search and show the same form , so help me using jsp
SEARCH AND SORT
SEARCH AND SORT Cam any one provide me the code in java that :
Program to
search for MAX,MIN and then SORT the set using any of the Divide and conquer method
SQL Alter Column Name
SQL Alter Column
Name
Alter Column
Name in SQL is used to change or modify the
name... a simple example on SQL Alter Column
Name. In
this Example, create
NameError: name 'SparkConf' is not defined
NameError:
name 'SparkConf' is not defined Hi,
What is solution of the error:
NameError:
name 'SparkConf' is not defined
Thanks
Hi,
You should import following line:
from pyspark import SparkConf, SparkContext
NameError: name 'SparkConf' is not defined
NameError:
name 'SparkConf' is not defined Hi,
What is solution of the error:
NameError:
name 'SparkConf' is not defined
Thanks
Hi,
You should import following line:
from pyspark import SparkConf, SparkContext