Write the definition of a method dashedLine , with one parameter, an int .
If the parameter is negative or zero, the method does nothing. Otherwise it prints a complete line terminated by a newline to standard output consisting of dashes (hyphens) with the parameter's value determining the number of dashes. The method returns nothing.
Here is what I wrote and is not working:
void dashedLine(int a){};
{
if (a>=0)
{
a=0;
}
if (a > '-' )
{
a= '-';
}
else
{
System.out.println( "a: " ='-');
}
return
Thanks for any help ...
2007-12-15
04:04:05
·
5 answers
·
asked by
cheryl b
1
in
Computers & Internet
➔ Programming & Design