Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import TerminalIO.KeyboardReader;
- public class AsteriskMania
- {
- public static void main(String[]args)
- {
- int numberLines = 0, i = 0, ii = 0, currentAsterisk = 0, numberOfAsterisk = 0;
- char yorN = ' ', asterisk = ' ';
- KeyboardReader reader = new KeyboardReader();
- do
- {
- numberLines = reader.readInt("Please enter the number of lines you would like: ");
- for(i = 0; i <= numberLines; i++)
- {
- asterisk = '*';
- System.out.print(asterisk + "\n");
- asterisk = '*' + '*';
- }
- yorN = reader.readChar("Would you like to repeat the program: ");
- }while(yorN == 'y' || yorN == 'Y');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement