Dot Awt
Dot Awt

Write a program that asks the user to enter two words....?
Write a program that asks the user to enter two words. The program then prints out both words on one line. The words will be separated by enough dots so that the total line length is 30
i hav done this but not able to get it right
// The "EnterWord" class.
import java.awt.*;
import hsa.Console;
public class EnterWord
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
//
String enterFirstWord,enterSecondWord;
c.print("Enter first word:");
enterFirstWord=c.readLine();
c.println();
c.print("Enter second word:");
enterSecondWord=c.readLine();
c.println();
c.print(enterFirstWord+"."+enterSecondWord);
} // main method
} // EnterWord class
please help me i am in urgent need
You could use a loop to output the dots.
// The "EnterWord" class.
import java.awt.*;
import hsa.Console;
public class EnterWord
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
int dots=30;
//
String enterFirstWord,enterSecondWord;
c.print("Enter first word:");
enterFirstWord=c.readLine();
c.println();
c.print("Enter second word:");
enterSecondWord=c.readLine();
dots -= (length(enterFirstWord)
+ length(enterSecondWord));
c.println();
c.print(enterFirstWord);
while (dots > 0 )
{
c.print(".'");
dots--;
}
c.print(enterSecondWord);
} // main method
} // EnterWord class
![]() |
![]() Ping Rapture V2 Irons 4 PW Purple Dot AWT X Stiff US $599.99
|
![]() Mint Ping Rapture 3 PW Ping AWT Steel Stiff black dot US $519.99
|
![]() Mint Ping Rapture 3 PW Ping AWT Steel Reg black dot US $519.99
|
![]() AWESOME 2010 PING G15 irons 4 PW AWT reg RH red dot US $512.99
|
![]() Ping G15 Red Dot Irons AWT Stiff 456789PW Nice US $425.00
|
![]() Ping i10 Red Dot Iron Set 5 UW AWT Reg Golf Clubs US $379.00
|
![]() Ping i10 Irons 3 PW Black Dot w AWT Shafts US $324.99
|
![]() PING I10 BLACK DOT IRONS 4 PW SW AWT STEEL REG US $319.99
|
![]() Ping G10 G 10 3 PW UW Steel AWT Stiff Green Dot US $389.99
|
![]() Ping G10 Irons White Dot 7 9PWUW AWT Stiff Cushin US $300.00
|
![]() Ping I10 Iron Set LH 3 PW Green Dots w AWT Steel US $284.99
|
![]() Ping G10 Iron Set 6 SW Ping AWT Steel Reg Black Dot US $279.00
|
![]() Ping G10 Blue Dot AWT Stiff Saft New Grips 4 U 8 Clubs US $215.00
|
![]() Ping i10 Irons 4 PW Green Dot 3 4 AWT X Stiff US $199.99
|
![]() PING I10 s58 combo iron set purple dot awt stiff US $162.50
|
![]() Ping i10 Iron Golf Set Yellow Dot Stiff AWT Steel US $275.00
|
![]() PING i15 IRONS 6789 RED DOT AWT STIFF US $132.50
|
![]() NEW Ping G10 2 Iron Black Dot AWT Steel R RH US $99.00
|
![]() NEW Ping G10 2 Iron Blue Dot AWT Steel S 1 2 RH US $99.00
|
![]() NEW Ping G10 2 Iron Green Dot AWT Steel S 3 4 RH US $99.00
|
![]() NEW Ping G10 2 Iron White Dot AWT Steel R 1 4 RH US $99.00
|
![]() Ping i10 7 Iron Black Dot AWT REG Flex Steel RH US $89.99
|
![]() Ping Rapture V2 Gap Wedge Purple Dot AWT X Stiff US $89.99
|
![]() Ping G10 58 BLACK DOT LOB WEDGE AWT STEEL REG FLEX US $89.00
|
![]() Ping i10 9 Iron Black Dot AWT REG Flex Steel RH US $79.99
|
![]() Ping G15 Black Dot Single 8 Iron AWT Steel Stiff US $79.99
|


US $599.99
























