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 G15 Irons Set 4 PW SW Black Dot Std Golf Clubs AWT Steel Regular NEW US $639.95
|
![]() Ping G15 Irons Set 4 PW SW Black Dot Std Golf Clubs AWT Steel Stiff NEW US $639.95
|
![]() PING K15s Red Dot PING AWT Reg Flex Steel 5 PW34 Hybrids LH EXCELLENT US $549.95
|
![]() Ping g15 g 15 Black Dot 5 UW AWT Regular Flex Irons Iron Set US $499.99
|
![]() Ping G10 Irons Green Dot 3 PW SW LW Regular Flex AWT US $499.95
|
![]() Ping G15 G 15 5 PW Regular AWT Steel Black Dot Std Length US $479.99
|
![]() Ping G15 Irons 6 PWUWSW AWT Regular Yellow Dot Stdlength MINT US $479.99
|
![]() PING G15 IRONS 4 PW UW YELLOW DOT RH AWT STEEL SR or SENIOR MINT US $529.00
|
![]() RH Ping Rapture V2 3 PWUW Yellow Dot AWT Regular Flex Classic US $475.00
|
![]() Ping i15 i 15 Black Dot 5 PW AWT Regular Flex Irons Iron Set US $459.99
|
![]() Ping i15 4 UW Blue Dot Ping AWT Stiff Flex Shafts Irons Iron Set US $459.99
|
![]() Ping i15 4 PW Yellow Dot Ping AWT Stiff Flex Shafts Irons Iron Set US $439.99
|
![]() PING G15 G 15 5 PW Regular AWT Steel Green Dot Irons Iron Set US $439.99
|
![]() PING G10 G 10 XG BLACK DOT IRONS 4 AW PING AWT REGULAR STEEL USED US $399.99
|
![]() PING I 10 I10 BLACK DOT 4 PW IRON SET AWT STIFF STEEL USED RH IRONS US $399.99
|
![]() PING I10 i10 GREEN DOT 4 PW IRON SET AWT STIFF FLEX STEEL USED RH IRONS US $399.99
|
![]() SUPER PING G10 5 PW BLACK DOT STIFF AWT STEEL RHFREE BRAND NEW NIKE GOLF BALLS US $399.99
|
![]() Ping K15 Iron Set K 15 5 PW AWT Regular Flex Steel Yellow Dot 05 Long US $439.00
|
![]() Ping G10 Blue Dot 4 PW Irons Set AWT Regular Steel MINT 7 clubs Matching Serials US $389.95
|
![]() PING RAPTURE V2 WHITE DOT IRONS IRON SET 6 PWU WEDGE Steel AWT Stiff 1 2 US $360.99
|
![]() PING Rapture V2 S57 Orange Dot PING AWT Reg Flex Steel 4 PW MATCHING s SWEET US $359.95
|
![]() Ping S57 Iron Set S 57 3 W PING AWT Stiff Flex Steel Green Dot MINT US $350.00
|
![]() PING G10 YELLOW DOT 5 PW IRON SET AWT STIFF STEEL USED RH IRONS US $349.99
|
![]() PING G10 G 10 BLACK DOT IRONS 4 PW PING AWT STIFF STEEL USED US $349.99
|
![]() Ping G10 Iron Set 4 UW AWT Stiff Purple Dot Golf Club US $349.99
|
![]() PING G10 RED DOT 5 PW IRON SET AWT STEEL REGULAR USED RH IRONS 1 2 US $349.99
|


US $639.95
























