473,699 Members | 2,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

searching several arrays

hello,
i am trying to make a java program that will take several different
arrays and search through them in a loop

suchs as:
for (i=0; i < 5; i++)
{
if (firstarray[1]<such and such
{
blah blah
}
but i can't figure out how to make the program look at my first array,
then move to my second array, i have only found how to make a loop
look at the different elements of one array. any help is appreciated!
Jul 17 '05 #1
2 2036

"Bryce Maschino" <ho***********@ hotmail.com> wrote in message
news:3b******** *************** ***@posting.goo gle.com...
hello,
i am trying to make a java program that will take several different
arrays and search through them in a loop

suchs as:
for (i=0; i < 5; i++)
{
if (firstarray[1]<such and such // ***Add this** ****doem both in the same loop - searchemAll at the same
time*****
if (secondArrar[i] < suchNsuch){
yadda-yadda} {
blah blah
}
but i can't figure out how to make the program look at my first array,
then move to my second array, i have only found how to make a loop
look at the different elements of one array. any help is appreciated!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004
Jul 17 '05 #2
I intend my response to be sincere: please treat is as such.

Bryce,
You mention having a number of arrays.
You want to search them by referring to them sequentially, I assume.
Do you have your arrays by seperate names?
If so, what about having a vector or array of your arrays.
Or, build a class which has an array as a part of it and place these objects
into a container(gener ically speaking).
Then do two loops:
for(each of the arrays/objects in such a container){ // you know how
to modify this???
for(each element of each array){
// do the search you want to do
if(itemFound){
// engage your process
}
else{
// keep looking
}
} // next item
} // next array filled object
Is this the process you are trying to articulate?
Steve
"Hal Rosser" <hm******@bells outh.net> wrote in message
news:jp******** **********@bign ews3.bellsouth. net...

"Bryce Maschino" <ho***********@ hotmail.com> wrote in message
news:3b******** *************** ***@posting.goo gle.com...
hello,
i am trying to make a java program that will take several different
arrays and search through them in a loop

suchs as:
for (i=0; i < 5; i++)
{
if (firstarray[1]<such and such

// ***Add this** ****doem both in the same loop - searchemAll at the same
time*****
if (secondArrar[i] < suchNsuch){
yadda-yadda}
{
blah blah
}
but i can't figure out how to make the program look at my first array,
then move to my second array, i have only found how to make a loop
look at the different elements of one array. any help is appreciated!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1425
by: nt9 | last post by:
I am very new with php so excuse me please if the question seems really easy.I have a page(form) which displays a list of the titles of some books(retreived from a database) and each title has a selection box with option values 1 to 7 each.The user should be able to enter 7 choices of his favourite books and store them in the database at a table called preferences with fields: customer_id ,first_choice, sec_choice,third_choice etc.I am...
2
2529
by: John | last post by:
Hi everyone ! This is a first time I post a message here. If I post my message in a wrong group. Please ignore it. I am trying to build a website which allows users (can be thousands of users, supposedly) to upload their files to their designaged directories (max 15 files for each user). A super user (can be more than one) want to search for a particular file name and also a particular textual part of a file of all user's files in all...
5
5396
by: Alan Mackenzie | last post by:
I've recently moved onto a C++ project with a large number of directories (several hundred) containing an even larger number of C++ source files. There are vastly more ways in C++ to obfuscate a program than there are in C, and it seems somebody laid a bet on the original development team to prove that this is the case. ;-( Unfortunately, I have no contact with the original programmers, who live and work on a different continent. In...
1
2286
by: Scott Handojo | last post by:
Lets say I have the following arrays X1 (1, 2, 7, 8) X2 (1, 2, 4, 6) X3 (1, 2, 3, 5) X4 (1, 3, 5) X5 (2, 3, 5) X6 (4, 5, 6, 8) My 'search array' is comprised of
1
1471
by: Bud Dean | last post by:
I need to search files for given text. In particular, I'm searching dll's, exe's, asp, aspx and html pages. I am having difficulty converting the byte arrays to strings. The following code identifies the file and line number where the text appears. It appears to work, but... I would appreciate any suggestions for improvement. heres the code: *********************Start Code ****************************
1
1863
by: BlackJackal | last post by:
Alright here is the problem I have for homework. I understand most of it but I am not exactly sure what the problem is asking me to do or how to search the seperate arrays using the account number to return the values. Any help would be appreciated I just don't think I understand what is being asked of me. The problem is as follows A bank's cusomer records are to be stored in a file and read into a set of arrays so that an individuals...
4
5342
by: Hunk | last post by:
Hi I have a binary file which contains records sorted by Identifiers which are strings. The Identifiers are stored in ascending order. I would have to write a routine to give the record given the Identifier. The logical way would be to read the record once and put it in an STL container such as vector and then use lower_bound to search for a given identifier. But for some strange reason i'm asked to not use a container but instead...
11
1923
by: jimxoch | last post by:
Hi list, Most STL containers are storing their data on the heap. (although some std::string implementations are notable exceptions) Of course, using the heap as storage increases flexibility and allows the handling of much bigger amounts of data. However, there are cases where this turns out to be inefficient for at least two reasons: A) Allocations and deallocations on heap are much slower. B) Memory access on stack is more cache...
5
3184
by: lemlimlee | last post by:
hello, this is the task i need to do: For this task, you are to develop a Java program that allows a user to search or sort an array of numbers using an algorithm that the user chooses. The search algorithms that can be used are Linear Search and Binary Search. The sorting algorithms are bubble, selection and Insertion sort. First, the user is asked whether he/she wants to perform a search option, a sort operation, or exit the program. If...
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7745
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.