Home Answers Viewqa Java-Beginners search for a name

 
 


Rosmi Stephen
search for a name
1 Answer(s)      2 years and 4 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?}

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 Pages:
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
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
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
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
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
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
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
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
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
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
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
search
search  how to develop search box and how to retrive data from database..   Please visit the following link: Search box
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
personal name aliase from the web
personal name aliase from the web  enter the name to search result in internet connection
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
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
Major Search Engines List
, Netscape Search and Lycos to name just a few. Open Directory Project... Major Search Engine Lists       Listing of 10 Top Search Engines
How to perform search using AJAX?
How to perform search using AJAX?  Hi, I have following HTML code...; <td><label for="status">Search Status</td> <td><input type="text" id="status" name="status" dojoType="dijit.form.TextBox" size="40
How to register domain name
to register. Follow the rules regarding name length and format. Search...Domain name registration is the first step to start any website.  Website requires a name to be known and referred to on the web. Domain name
Hibernate Criteria Case Insensitive Search.
Hibernate Criteria Case Insensitive Search.  How to use Case Insensitive Search in Hibernate?   The Case Insensitive ignores the case... =session.createCriteria(Employee.class); criteria.add(Restrictions.like("name", "r
How to search entry in ZipFile.
How to search entry in ZipFile. In this tutorial, We will discuss the use... will search given entry in a zip file. The getEntry method search...() The getEntry() method  returns given name entry if entry found otherwise
PHP SQL Search
PHP SQL Search       PHP SQL Search is used to return the records details from the table based on the search condition. The PHP SQL Search allows the user to put his search
Java search text file
the name of a text file to search for. If the name does not have a .txt extension, display an error message. Then search the file in the current directory...Java search text file In this tutorial, you will learn how to search a text
Code for search data - Development process
Code for search data  Hi, can u give me jsp code for search data. When i select any 1 from 3, it has to display all d corresponding data from database sub-combo box in this code is not working. Search Page
automatic discovery personal name aliases from the web
automatic discovery personal name aliases from the web  gogle web page display search the result
automatic discovery personal name aliases from the web
automatic discovery personal name aliases from the web  i want for web search area display code
MySQL PHP Search
MySQL PHP Search       MySQL Search is used to search and return a records from a table... The Tutorial illustrate an example from 'MySQL PHP Search'. To understand
automatic discovery personal name aliases from the web
automatic discovery personal name aliases from the web  enter the name and enter the button to search result for internet connection below
automatic discovery personal name aliases from the web
automatic discovery personal name aliases from the web  create a text field in enter the name and search button to below result in internet connection
save links clicked in search engine results
; <input size=30 name=p> <input type=submit value="Search"> </form>...save links clicked in search engine results  hello i need to access search engine results in my program(any search engine).ie suppose i give
JSP Search Example code
JSP Search - Search Book Example       Search Book Example In this tutorial we are going to develop a small sample JSP search application that searches
Redirect to Google Search JSP
Redirect to Google Search JSP This tutorial explains you how can you crate a google search in your page. Redircting to google search means the text what you have entered into the textbox in your page, the google search should fetch
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 bar application
Search bar application In this tutorial, will be creating a Search screen, which have a table view with a search bar. Table should display all the data if search field is empty other wise it should show all the data which matches
Java Get Host Name
Java Get Host Name       In this Example you will learn how to get host name in Java. Go through the below given code to understand how it works and gets the host name
PHP Array_search functions
Learn PHP Array_search functions There are more then hundreds of functions... in the PHP.  In general array_search function searches array, for the given... are looking for the name of an employee who has the employee ID 6872. How will you
Search data from database - Java Beginners
with two button search and delete. 2:- User input name(with alphabetical... to user name. (means search all field from database and display using...Search data from database  Hi Deepak, This is not correct code
Help on this java code for online library search
name"); JRadioButton rbbook = new JRadioButton("Search by Book name...Help on this java code for online library search   I have written the following java code for simple library book search. but its having some errors
JSP Servlet Search and Edit - JSP-Servlet
JSP Servlet Search and Edit  Hi, I want to thank the people who... there is a search which populates the search result table, On single click..., You can search on the basis of any field but it should be in the form
Top 10 SEO Mistakes,Common Mistakes in Search Engine Optimization,Search Engine Marketing Mistakes
Search Engine Mistakes - Search Engine Optimization Mistakes... design good website and promotes in the search engines for getting visitors... content but they do not rank well on the search engine results. These low placements
Search from Database In Servlet
Search from Database In Servlet       In this section, we have developed an Employee Search... search.jsp in the browser and enter the search text  and click
SEO Guide,Search Engine Optimization,Basic of SEO,Search Engine Optimization Information
;META name="Description" content="Search Engine optimization... Search Engine Optimization What is Search Engine Optimization? Search... ranking within search engines. Search Engine Optimization are done to attend
Mysql Date Search
Mysql Date Search       In this Tutorial you will learn how to' search Date in Mysql'. To understand...) NOT NULL auto_increment,  `emp_name` varchar(100) NOT NULL, 
Welcome to Free search engine secrets: webmaster's guide to search engine registration!
to several search engines. How to increase your web traffic. We provides services to promote your site in various search engines like Altavista....     85% of Internet users find sites through search
search in Two Tables to Find data and view by jsp
search in Two Tables to Find data and view by jsp  hi i want search...("name") %></td> <td><%= rs.getString("accountno") %><...("name") %></td> <td><%= rs.getString("accountno") %><
how to show search results in the same panel of jframe to where search field and button is present..
how to show search results in the same panel of jframe to where search field... where i have to show the search result in the same panel of where search field... next search value in the textfield it makes another set of columns
Java search word from text file
. It then scan the whole file to search the name and display the id and marks...Java search word from text file In this tutorial, you will learn how to search... created a text file student.txt which consists of id, name and marks of few

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.