Can anyone help me with this please?
Modify the FileTokenTester program from the lecture to reverse the tokens in each input string line and output the reversed version to a file,
apple banana orange strawberry?
becomes
strawberry orange banana apple?
This is all l can do?
class FileTokenTester
public static void main (String args[] )
String inline;
StringTokenizer st;
// file handling is enclosed in a try-catch block as methods called
// may throw exceptions.
try
// set up a Reader on the input file
FileInputStream fis = new FileInputStream("c:\\temp\\inputToken.txt");
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader bf = new BufferedReader(isr);
// set up a Writer on the output file
FileOutputStream os = new FileOutputStream("c:\\temp\\output.txt");
PrintWriter pw = new PrintWriter(os);
// read the first line of input
inline = bf.readLine();
// loop until there is no more input
while (inline != null)
st = new StringTokenizer(inline );
while (st.hasMoreTokens())
pw.println(st.nextToken());
inline = bf.readLine();
pw.close(); // have to close the output stream to flush the buffer
// and commit the output.
catch (Exception e)
System.out.println("Caught Exception: " + e.getMessage()) ;
}
1) Please use code tags. Reinsert your original code, so that the tab spaces remain the same.
2) homework isn't so popular in this forum.
3) If you have any problems, reduce it to the relevant code and post the error message.
4) what is your question, anyway?
Similar Messages
-
I am not able to Mobile Me email account to connect with iCloud or my Apple Mail program. Don't know if my settings are correct or not. Can anyone help me with this please?
http://support.apple.com/kb/HT5922
If you want to mirror your desktop, see:
http://support.apple.com/kb/HT5404
Regards. -
I have a brand new MacBookProo and I can not open PDF files from my desktop. Can anyone help me with this please?
A new Mac comes with 90 days of free tech support from AppleCare.
AppleCare: 1-800-275-2273 -
SUddenly my music videos won't play on my ipad1. I just get the audio. Can anyone help with this please?
Look in the Videos App and play them in there.
-
I've always used itune cards but now I would like to put my credit card info in itunes and can not figure out how to do it can anyone help me please
If you tap on your account id in Settings > iTunes & App Stores you should be able to view your account info (after you've typed in your password) and you should get a payment details option. Or you can do it via the Store > View My Apple ID drop-down menu option on your computer's iTunes
-
My Apple Loops are not selectable. Can anyone help me with this please?
Whenever I open up my Apple Loops on Logic Pro X, they are not selectable.
I have tried reinstalling the program and reinstalling the loops, but that did not work.
Any help would be much appreciated. Thanks!What do you mean.. nothing happened?
Make sure you followed the instructions exactly.....
From the Apple () menu, choose System Preferences.
Click Spotlight.
Click the Privacy tab.
Drag a folder or an entire volume (your hard drive) to the list.
If prompted for confirmation, click OK.
Remove the item or volume you just added to the list by clicking it and then clicking the minus ("-") button.
Close Spotlight preferences.
Spotlight will re-index the contents of the folder or volume. -
my ipod nano 3 generation keep turn in and off even when the hold botton is in on possicion can anyone help me with this please?
iPod Manuals
-
"It is formatted incorrectly, or is not a format that iBooks can open". Can anyone help me with this message of a book that I purchased on iBooks, read, highlighted in the book and now I can't open it anymore. Please help!!!
Mine does the same thing occasionally, is your phone jailbroken? Sometimes it will work if you delete the book and reinstall it or put your phone into airplane mode then turn it back off.
-
When typing the name of the contact I want to send a text message to, names from my contact list no longer pop up as suggestions. Can anyone help me with this?
There's always a way to reset the device jmn33! Thanks for keeping us in the loop. To process a full reset/restore on the device please visit http://vz.to/12TLCsR. Please keep us posted once this is completed, thanks!
MatthewS_VZW
Follow us on Twitter @VZWSUPPORT -
Want to install Skydrive on my mac, but the app store wants US billing information and I am in Gibraltar. Can anyone help me with this?
Yes, if this is a permanent change. But you still have to have all the other changes - billing address, credit card, residence, etc. See Manage My Apple ID.
If you can't remember answers to security questions:
The Three Best Alternatives for Security Questions and Rescue Mail
1. Use Apple's Express Lane.
Go to https://expresslane.apple.com ; click 'See all products and services' at the
bottom of the page. In the next page click 'More Products and Services, then
'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
ID security questions' and click 'Continue'. Please be patient waiting for the return
phone call. It will come in time depending on how heavily the servers are being hit.
2. Call Apple Support in your country: Customer Service: Contact Apple support.
3. Rescue email address and how to reset Apple ID security questions.
A substitute for using the security questions is to use 2-step verification:
Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID. -
I can't find the 2G, 3G and LTE options after updating to iOS8.1, can anyone help me with this? I'm using iPhone5s
I have check on my service provider about the correct APN settings, but unfortunately doesnt work still..
-
I need to reinstall my operating system for 10.5 after seeing a file folder and question mark flashing on my start up screen. Can anyone help me with this?
Hello,
That means it can find the Hard Drive, or can't find the things needed for booting.
See if DU even sees it.
"Try Disk Utility
1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
*Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
3. Click the First Aid tab.
4. Select your Mac OS X volume.
5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
http://docs.info.apple.com/article.html?artnum=106214
Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
(Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.) -
Hi can anyone help with this issue regarding my wireless magic mouse? When im on google chrome and scrolling down the page i always have youtube running in the background but the audio cuts/spits/pops can anyone help me with this?
The figures you mention only make sense on your intranet. Are you still using the same wireless router. The verizon one is somewhat limited as far as max wireless-n performace. For one thing it only has a 2.4 radio. I like many people who wanted wireless-n performance before they even added a wireless-n gigabit router, have my own handling my wireless-n network.
-
When my screen saver has been on a while, I have to use the cursor to "rub out" part of the screen saver to see my login section. Can anyone help me with this?
I don't have a solution for you, but just wanted to let you know I used to have the exact same problem. I resolved it (for the most part....about 90% of the time, anyway) by adjusting the screensaver and power settings to never let the computer go to sleep.
-
(The iPhone "Named" cannot be restored at this time because the iPhone software update server could not be contacted or is temporarily unavailable.)
can anyone help me with this issue, every time i try to restore it will come up like this error message.Restore the iPhone when connected to iTunes by cable.
Still the same TS1275?
Is your iPhone jailbroken?
Or
Has your computer ever been used to jailbrake or downgrade (Tinyumbrella) any iPhone?
Maybe you are looking for
-
Why is my iPad asking for a password after I updated it and now has me locked out
AAfter doing the new update my iPad is asking for a password I do not have and has me locked out?why?
-
Validation not working on Qualified Field!!!! is this Normal!!!
Hi All, I have an Integer field in the Qualified table. Name-> Non Qualifier -> Type Text Code -> Qualifier -> type Integer Now, i need to write a validation which throws error If user enters a number whose length is less than 4 or greater than 4.
-
Dear friends, My question is about PO approval strategy. I add a new field to CEKKO (ERNAM - name of person who created the object) and create a characteristic (Z_ERNAM) that referrers to CEKKO-ERNAM. Then assign this characteristic to PO release cla
-
HT1338 My desktop screen changes when I wake it up
Not sure what has happened - but when I don't 'shut down' my macbook air and just close it, when I open it the old desktop theme milky way, comes back. I upgraded to Mountain Lion, when I open my att mail it takes forever to upload. ????? Anybody kno
-
How do I recover photos that corrupted when I upgraded to iphoto 11?
I just installed iphoto 11 on my macbook and stupidly didn't back up my library, When the library was rebuilt, 40 photos have corrupted - weirdly, all the corrupted photos are black and white, landscape - and any photos in the sequence that are portr