Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
literally1984 authored Jun 21, 2021
1 parent 5408382 commit 8e1ea41
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Main.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import java.util.Scanner;

class Main {
public static void main(String[] args) {
System.out.print("\033[H\033[2J");
Expand All @@ -18,6 +19,11 @@ public static void main(String[] args) {
if (inputnumtimes.charAt(keeptrack) >= '0' && inputnumtimes.charAt(keeptrack) <= '9') {
keeptrack = keeptrack + 1;
}
else if (inputnumtimes.substring(0,1).equals("-")) {
inputgoodornot = false;
System.out.println("Error: Entered number must not be negative. Try again?");
break;
}
else {
inputgoodornot = false;
System.out.println("Error: User input must not include characters other than numbers. Try again?");
Expand All @@ -35,4 +41,4 @@ public static void main(String[] args) {
System.out.println("");
System.out.println("'" + inputchar + "'" + " was printed " + numoftimes + " times");
}
}
}

0 comments on commit 8e1ea41

Please sign in to comment.