MayaIP

Untitled

Jun 5th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. /**
  2. * Created by maya on 6/6/2017.
  3. */
  4. public class BlankReceipt {
  5. public static void main(String[] args) {
  6. printReceipt();
  7. }
  8.  
  9. public static void printReceipt()
  10. {
  11. PrintReceiptHeader();
  12. PrintReceiptBody();
  13. PrintReceiptFooter();
  14. }
  15.  
  16. public static void PrintReceiptHeader()
  17. {
  18. System.out.println("CASH RECEIPT");
  19. System.out.println(newString("-", 30));
  20. }
  21.  
  22. public static void PrintReceiptFooter()
  23. {
  24. System.out.println(newString("-", 30));
  25. System.out.println("\u00a9 SoftUni");
  26. }
  27.  
  28. public static void PrintReceiptBody()
  29. {
  30. System.out.println("Charged to____________________");
  31. System.out.println("Received by___________________");
  32.  
  33. }
  34.  
  35. public static String newString(String text, int repeatCount) {
  36. String a = "";
  37. for (int i = 0; i < repeatCount; i++) {
  38. a += text;
  39. }
  40. return a;
  41. }
  42. }
Add Comment
Please, Sign In to add comment