I have a feeling it is something simple troubling me, I just cant find out what that problem is. The progam is SO CLOSE! please help me. - public class BubbleSort2
-
{
-
public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
String linetext;
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
filage=inWords.readLine();
-
-
while((linetext=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
}
that little bit is the problem, I can compile and run, but it only executes the first line of the file and asks for the file again, then does the first line AGAIN and asks for the file AGAIN and so on and so forth repeating untill I terminate the box. If you have any suggestions, me and my friend are having the same problem, thanks for your time,
Steve
14 2518
I have a feeling it is something simple troubling me, I just cant find out what that problem is. The progam is SO CLOSE! please help me. - public class BubbleSort2
-
{
-
public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
String linetext;
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
filage=inWords.readLine();
-
-
while((linetext=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
}
that little bit is the problem, I can compile and run, but it only executes the first line of the file and asks for the file again, then does the first line AGAIN and asks for the file AGAIN and so on and so forth repeating untill I terminate the box. If you have any suggestions, me and my friend are having the same problem, thanks for your time,
Steve
This is only ossible if you have print out in the sort method which you decided not to post. Please post the whole class.
This is only ossible if you have print out in the sort method which you decided not to post. Please post the whole class.
I was wondering if you coult do the "String Data=inData.rea dLine(Counter); " to read each line and just bump it up but it said it couldn't resolve the symbol, I pretty much am out of guesses at this point.
I was wondering if you coult do the "String Data=inData.rea dLine(Counter); " to read each line and just bump it up but it said it couldn't resolve the symbol, I pretty much am out of guesses at this point.
What do you want the lines -
-
String filage="";
-
String linetext;
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
filage=inWords.readLine();
-
-
while((linetext=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
-
to do?
I want them to find the data file inputted at the command prompt and run the program for each line with the while statement
I want them to find the data file inputted at the command prompt and run the program for each line with the while statement
Then
should be - public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
-
-
while((filage=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
-
}
^^^^
that gives the same repeating results
- public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
-
-
while((filage=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
-
}
^^^^
that gives the same repeating results
So filage is actually a line of data from your file.
Now have a look at - Data=seekBufferedReaderData(filage);
-
.
And that method takes the fileage and tries to open a file called filage!
sorry, I dont follow. I just want to fill an array with each subscript being a different line of the test values
EX.
1.) 2 3 4 5
2.) 3 6 2 6
3.) 9 2 5 6
i want NumberArray[0]==2 3 4 5 and NumberArray[1]==3 6 2 6, etc etc. I think I can work it out if I can get some direction on that.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Avi Schwartz |
last post by:
In this issue the following statement is made:
"In plpgsql, you cannot run a dynamic SELECT statement and be able to
do anything with the selected data. You cannot assign the selected
value to a variable or return the selected value from the function. You
can, however, easily construct INSERT, UPDATE and DELETE statements as
well a DDL (Data Definition Language: CREATE, ALTER, etc.)"
This is not my experience. For example, I am doing...
|
by: Danny J. Lesandrini |
last post by:
The following code works with a standard MDB to navigate
to a particluar record (with a DAO recordset, of course)
but it's giving me problems in an ADP I'm working on.
Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone
rs.Find "=" & lngContractID
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I must site the Heisenberb Uncertainty Principal here, as it
|
by: Eric |
last post by:
I'm looking at this page in the MSDN right here:
ms-help://MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemcollectionsarraylist
classsynchronizedtopic2.htm
(or online here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionsicollectionclasssyncroottopic.asp)
And I'm interested in locking an ArrayList during the entire enumeration, as
shown in the example code. My problem is that I'm STILL...
|
by: IntraRELY |
last post by:
I have a loop that loops through this sub. However, I recieve an
WebException error in my try statement. "An exception occurred during a
WebClient request." This message doesnt happen when I am only looping
throught the sub once, however when I process multiple records, I recieve
this error for every record after the first one.
And the images that is downloaded does show up for all records processed. So
everything works there is just an...
|
by: Mrinal Kamboj |
last post by:
Hi ,
I am confused that's is not even correctly mentioned in MSDN , if my
code snippet works , have a look at this :
1. string s = {"1", "2","3"} ;
foreach(string ss in s)
{
ss = "4" ; // Compilation error as foreach loop is Read Only as
| |
by: matchine |
last post by:
This is a recommendation based on my research on an issue with the
transfer text functionality. The comments below were from a tech I
approched for help.
"The transfer text process blocked after importing 6139 records each
time on my side. After further research, there maybe a memory leak in
TransferText. When the number of records exceeds its limitation, the
transfer process blocked. Therefore, please abandon TransferText and
write...
|
by: ataanis |
last post by:
Hi,
I have the following statement, and i'm trying to understand why when
I do the second print it's giving me segmentation fault, both name
and s_aliases are char arrays e.g
THE FIRST PRINT WORKS FINE , which means that the aliases are in
s_aliases
char names and char s_aliases, h is a structure , that
contains s_aliases
defined as
|
by: Ryan |
last post by:
Hello. I was hoping that someone may be able to assist with an issue
that I am experiencing. I have created an Access DB which imports an
Excel File with a particular layout and field naming. Next the user
can go into a Form which basically a dynamic query with a friendly
interface that eventually outputs a table that is stored in the DB as
well as exported to a CSV file. The CSV file is then used with a
vendor solution to fill in...
|
by: Kelii |
last post by:
I've been trying to get this piece to work for a few hours, but have
given up. I hope someone out there can help, I think the issue is
relatively straightforward, but being a novice, I'm stumped. Below you
will find the code I've written and the error that results. I'm hoping
that someone can give me some direction as to what syntax or parameter
is missing from the code that is expected by VBA.
Overview:
I'm trying to copy calculated...
|
by: pmlane2001 |
last post by:
I have a PHP SOAP XML file size problem that I was wondering if anyone has seen before. I have an XML file that when I put it through my PHP script with 270 lines (13,082 KB) it works fine. If I make it 271 lines (13,112 KB), it causes the script to end with a soap fault.
I've tried adding substance to the 270 lines to make the file bigger with out adding lines, but it didn't fail.
I've installed everything on a second development box...
|
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...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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,...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
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...
| |