I already did the following code that outputs a right arrow but I need help maki
ID: 3532368 • Letter: I
Question
I already did the following code that outputs a right arrow but I need help making the left one. Please I really need help. :(
Below is the code I have for the right arrow.
import java.util.Scanner;
public class TestLeftArrow
{
public static void main(String[] args)
{
int length=10;
int l=1;
int base=11;
for (int i=0;i<base/2+1;i++)
{
for (int j=0;j<length+l;j++)
{
if (j==length || j==length+l-1 && i<=base/2)
System.out.print('*');
else if (j<length && i==base/2)
System.out.print('*');
else System.out.print(' ');
}
l++;
System.out.println();
}
l-=2;
for (int i=0;i<base/2;i++)
{
for (int j=0;j<length+l;j++)
{
if (j==length || j==length+l-1)
{
System.out.print('*');
}
else System.out.print(' ');
}
l--;
System.out.println();
}
}
Explanation / Answer
//please rate
http://ideone.com/SNqyPk
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.