Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners search for a name

Have Programming Question? Ask it here!
 
 
 


Rosmi Stephen
search for a name
1 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners


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?}


Advertisement
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*



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
How to search the table name in MS SQL Database 2005 from application
How to search the table name in MS SQL Database 2005 from application  How to search the table name in MS SQL Database 2005 from application from our helpdesk application? application might be in html
Advertisements
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
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 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 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
Search index
Search index  how to write code for advanced search button
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
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
iPhone Baby Name App, iPhone Baby Name, Baby Names application for iPhone
. In our iPhone baby name application search is very fast and you can search... internet to search a baby name Baby names application runs...iPhone Baby Name App - World Baby Names
Search Engine
Search Engine  I have gone through the below mentioned link document to create search engine and fetch the data from mysql database.But i am getting errors. http://www.roseindia.net/sql/mysql-table/sql-search.shtml Error: Notice
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 feature - JSP-Servlet
search feature  i need help to do a search feature servlet to search for employees from the database. the search will be done by search by employee name, department and email  Hi friend, As per your problem
Google Search
Google Search  I have a textbox and submit button in my JSP page. On giving word in the textbox and click submit it should redirct to google search page and fetch all the results based on my input word automatically. JSP/Servlet
Array search
for the search operation. he value with one or more of the array items. Search begins
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
php search variable
php search variable  Search variable in PHP
AJAX Search
.. <?php $db_host = 'Your database host name'; $db_username = 'Your datbase username'; $db_password = 'Your database password'; $db_name = 'Your database name'; $db = new mysqli($db_host, $db_username ,$db_password, $db
personal name aliase from the web
personal name aliase from the web  enter the name to search result in internet connection
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
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
simple java search engine
simple java search engine  i have already downloaded the project simple java search engine.but i am not able to run it.can anyone help me.i have.... ABSTRACT Title : Simple Search Engine System Specification: The system on which
Lucene Search in JSP - JSP-Servlet
Lucene Search in JSP  Hello Sir, I want to Develop lucene - Search engine in Jsp page which can Search full text from XML file..through XML parser.. Example: in Search interface there are one textbox after putting some value
search filter and JTable
search filter and JTable  I first im not speak englis very well, so my question is: how can i make search data in JTable of java? i wan to search... java.sql.*; import java.awt.event.*; import javax.swing.*; class Search{ public
email search code in php
email search code in php  email search with multiple option in php
JAVA: Recusrion, Binary Search
. Search medical records by animal name, owner, and animal kind (like show all...JAVA: Recusrion, Binary Search  I want to learn about Binary Search... information: Owner. Name of the animal. Age of the animal. Medical history
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
Search operation in JSP page
Search operation in JSP page  How to perform search in jsp with MYSQL database plz help me
mkmapkit location search
mkmapkit location search  How to create a location search function that will allow the current location search on the MKMapKit
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
binary search program
binary search program  write a program to searching a string using binary search
search operation - Java Beginners
search operation  how to retrive all the similar elements (search operation ) on xml document using regular expressions
need search query - WebSevices
need search query  I have a field in database as DOB. But I want to search recrods as per "fromage" to "toage". I dont know how to compare the ages...; create table stu(name varchar(10), dob date); insert into stu values('komal
Drop down for search textbox like google search
Drop down for search textbox like google search  I want drop down like google search (ie, when we type one letter then the word start with that are displayed). when the drop down list appear, then we can select one of word as our
jquery search for html pages
jquery search for html pages  i want to search html pages with jquery, it is k for single page but i want search more than one page at a time. Thank you in advance
NSMutableArray Search String
NSMutableArray Search String  Hi all, In my iPhone SDK application.. i wanted to search from the table data. My question is ..do i need to innsert the table data into search array? thanks
php file search
php file search  How to search file in PHP .. $dir = '/tmp
SEO and Search Engines,Best Search Engines on Web,What is Search Engine
SEO and Search Engine   ... of the search engine while doing SEO work. Since in SEO we are using search engine to promote our website, so understanding the search engine details like
Search million records????
Search million records????  How to get fast search results from a table with over 10 million record??? 11g Oracle DB
how to search - WebSevices
how to search  how can I write mysql query for the following search format? Search By:(this have following options)(name,username,email...(); ResultSet rs = st.executeQuery("select Name from Employee
Molu - The Search Spider
Molu - The Search Spider       www.themolu.com - Search engine which can search both Web 1.0 (Web search) as well as Web 2.0 (Tag search). Currently it gives a facility of searching web
search for exact match in excel
search for exact match in excel  How to search for an exact match in excel and show data if the matched sting is found? Please tell me the script. Thanks in Advance
search for exact match in excel
search for exact match in excel  How to search for an exact match in excel and show data if the matched sting is found? Please tell me the script. Thanks in Advance
Search engine for email
Search engine for email  Build a search engine which will look at your email inbox and sort your email into 5 or more bins according to some criteria (e.g. date, email address, text of the email
Advertisements
 

 

 

DMCA.com