Calaen
I am a massive cock who isn't firing atm!
- Joined
- Dec 22, 2003
- Messages
- 9,538
Having some problems taking in the Java at Uni,
Was wondering if anyone could shine some light on it for me.
My task is to write a program that will ask you to enter 2 words. the program will then print out both words on one line. However the words will be seperated by dots that will make the total length of the line 40. so if your first word was turtle and the second was abc, the output would be
turtle...............................abc
The program should check for certain conditions:
1. a word can not be longer than 37 characters;
2. there must always be atlest 2 dots in a line.
The program should ask for the first word till a word of acceptable length is entered. it then does the same for the second word.
once both words are input the prgram will either output an error message if the words are to long when combined;
or output the required line with words.
I have to write the program using while and/or do-while loops
It also says something about the length of a string can be found out using myString.length().
I can understand the basic of what I need to do but with regards to word length and adding the required number of dots im fooked.
Any pointers would be appreciated.
Cheers.
Was wondering if anyone could shine some light on it for me.
My task is to write a program that will ask you to enter 2 words. the program will then print out both words on one line. However the words will be seperated by dots that will make the total length of the line 40. so if your first word was turtle and the second was abc, the output would be
turtle...............................abc
The program should check for certain conditions:
1. a word can not be longer than 37 characters;
2. there must always be atlest 2 dots in a line.
The program should ask for the first word till a word of acceptable length is entered. it then does the same for the second word.
once both words are input the prgram will either output an error message if the words are to long when combined;
or output the required line with words.
I have to write the program using while and/or do-while loops
It also says something about the length of a string can be found out using myString.length().
I can understand the basic of what I need to do but with regards to word length and adding the required number of dots im fooked.
Any pointers would be appreciated.
Cheers.