Guest User

Untitled

a guest
Nov 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. public class ASCIIWindow {
  2. public static void main(String[] args) {
  3. final int SIZE=3;
  4.  
  5. // Produces Top Line
  6. System.out.print("+");
  7. for (int i = 1; i <= 2; i++) {
  8. for (int line = 1; line <= SIZE; line++) {
  9. System.out.print("=");
  10. }
  11. System.out.print("+");
  12. }
  13. System.out.println();
  14.  
  15. // Produces Top Fill
  16. for (int fill = 1; fill <= SIZE; fill++) {
  17. System.out.print("|");
  18. for (int bar = 1; bar <= 2; bar++) {
  19. for (int space = 1; space <= SIZE; space++) {
  20. System.out.print(" ");
  21. }
  22. System.out.print("|");
  23. }
  24. System.out.println();
  25. }
  26.  
  27. // Produces Middle Line
  28. System.out.print("+");
  29. for (int i = 1; i <= 2; i++){
  30. for (int line = 1; line <= SIZE; line++) {
  31. System.out.print("=");
  32. }
  33. System.out.print("+");
  34. }
  35. System.out.println();
  36.  
  37. // Produces Bottom Fill
  38. for (int fill = 1; fill <= SIZE; fill++) {
  39. System.out.print("|");
  40. for (int bar = 1; bar <= 2; bar++) {
  41. for (int space = 1; space <= SIZE; space++) {
  42. System.out.print(" ");
  43. }
  44. System.out.print("|");
  45. }
  46. System.out.println();
  47. }
  48.  
  49. // Produces Bottom Line
  50. System.out.print("+");
  51. for (int i = 1; i <= 2; i++){
  52. for (int line = 1; line <= SIZE; line++) {
  53. System.out.print("=");
  54. }
  55. System.out.print("+");
  56. }
  57. System.out.println();
  58. }
  59. }
Add Comment
Please, Sign In to add comment