473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Index locator using 2 deminsional arrays

1
Good day! This is my first time here. I haven't slept for days because of my project in school.

Please help me...

The Problem is:
using two dimensional arrays create a java program the will ask a number and display how the numbers inputted.
And ask what number to locate.


Sample Output:
*************************************
Enter a number:3

Input No. 1: 3
Input No. 2: 7
Input No. 3: 1

Input a number to locate: 7
7 is at index 1

**************************************
if number inputted is not in index display
"It is not in index"
Aug 30 '08 #1
1 1147
JosAH
11,448 Expert 8TB
So you basically have a few sub-problems:

1) prompt the user for an integer number;
2) create an array given a number;
3) prompt the user for a number to be stored in that array;
4) find a number in that array.

Those are basically the four methods you have to build. Methods 3) and 4) have
to use a loop of some form to iterate over that array. You can use the method 1)
for method 3) and 4) as well (it simply prompts the user and asks for a number).

All that your main() method has to do is call the other methods and implement
a bit of control flow logic (e.g. the user entered a negative number for step 1) and
you have to anticipate for that ...

btw, I don't see any two dimensional array here ...

kind regards,

Jos

ps. I removed your other (identical) thread.
Aug 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Q. John Chen | last post by:
All, What's the difference between a unique contraint and unique? sementically, if you want a column contain unique values, it is a contraint. And an index is for searching/sort. The questions...
25
by: sql_server_2000_user | last post by:
Hi, I have a table with about 305 million rows, and a composite primary key that consists of an ascending int and an ascending varchar(18), which is typically of length 13. Even if all the keys...
5
by: jim_geissman | last post by:
One table I manage has a clustered index, and it includes some varchar columns. When it is initially created, all the columns in the clustered index are populated, and then some of the longer...
6
by: tigr | last post by:
I am trying to read BLOBs from a large table (i.e., greater than 34K rows) using Java and the IBM JDBC driver (actually through an Application server). I get the following: SQL0429N The...
29
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array...
2
by: John | last post by:
Hello everyone, I'm currently writing a program to keep track of schedule changes at a school. The goal is to have someone using the program to declare changes, then the program writes a html...
11
by: motion musso aka: sathia | last post by:
this is it, how can i get the current index? couldn't figure it out. thank you for(i=0;myarray.length<i;i++){ do_something(); //i need the current myarray } bye bye
3
by: serge | last post by:
If you display the execution plan and run the following: SET STATISTICS IO ON go SELECT ProductID, SupplierID FROM Products WHERE SupplierID = 1
0
by: akp123 | last post by:
I have to read a BLOB locator in a data file and load its values from another file into a DB2 table. The BLOB locator is of type COMBINATIONS.001.0.456/ and its value is in COMINATIONS.001 file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.