Hi Guys, I am a java beginner, please keep that in mind. I have to make a program that reads a number, and then displays that amount of exclamation mark "!".
This is what i have:
import java.util.Scanner;
import java.io.PrintStream;
class E_HerhaalKarakter1 {
PrintStream out;
E_HerhaalKarakter1 () {
out = new PrintStream(System.out);
}
String printUitroeptekens (int aantal) {
String output = "!"
for (int i = 0; i <= aantal; i++) {
output.concat("!");
}
return output;
}
void start () {
Scanner in = new Scanner(System.in);
out.printf("Hoeveel uitroeptekens wilt u weergeven?\n");
if(in.hasNext()) {
out.printf("baldbla");
printUitroeptekens(in.nextInt());
out.printf("%s",output);
}
}
public static void main (String[] argv) {
new E_HerhaalKarakter1().start();
}
}
Thank you