Could someone give me some hints or clues about what i am trying to make
im making a program were i input the width,length and border of the program
Example:
width : 10
length : 10
border : 2
so output is
here my code so far
and i cant find why it wont work
sorry the output should be
++++++++++
++++++++++
++spaces++
++spaces++
++spaces++
++spaces++
++spaces++
++spaces++
++++++++++
++++++++++
im making a program were i input the width,length and border of the program
Example:
width : 10
length : 10
border : 2
so output is
++++++++++ ++++++++++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++++++++++ ++++++++++
here my code so far
and i cant find why it wont work
import java.util.Scanner;
public class Edze {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int row, col, bor;
System.out.println("Enter row: ");
row = input.nextInt();
System.out.println("Enter col: ");
col = input.nextInt();
System.out.println("Enter bor: ");
bor = input.nextInt();
for(int i = 1; i < row; i++){
if (i==1 || i == row)
System.out.print("*");
else
System.out.print(" ");
for(int j = 1; j < col; j++){
if(j==1 || j==col)
System.out.print("*");
else
System.out.print(" ");
for(int k = 1; k < bor; k++){
if(k==1 || k==bor)
System.out.print(" ");
else
System.out.print(" ")
}
}
}
System.out.print(" ");
}
}
sorry the output should be
++++++++++
++++++++++
++spaces++
++spaces++
++spaces++
++spaces++
++spaces++
++spaces++
++++++++++
++++++++++