modified: Java/Lab 2/Lab_2.java

This commit is contained in:
Rhinemann 2023-05-03 10:39:06 +03:00
parent 8013099c36
commit acc2d533cb
1 changed files with 10 additions and 7 deletions

View File

@ -46,17 +46,20 @@ public class Lab_2 {
Scanner input = new Scanner(System.in);
a = protectedInput("Input a constant to multipy a matrix by: ", "A constant must be a short-data type integer, try again.", input);
a = protectedInput("Input a constant to multipy a matrix by: ",
"A constant must be a short-data type integer, try again.", input);
System.out.println();
System.out.println("Input size of the matrix.");
do {
rows = protectedInput("Rows: ", "A number of rows must be a short-data type integer, try again.", input);
rows = protectedInput("Rows: ",
"A number of rows must be a short-data type integer, try again.", input);
} while (rows <= 0);
do {
columns = protectedInput("Columns: ", "A number of columns must be a short-data type integer, try again.", input);
columns = protectedInput("Columns: ",
"A number of columns must be a short-data type integer, try again.", input);
} while (columns <= 0);
input.close();