The first step is to create a
void method to print the upper part of the receipt (header). Let's give it a meaningful name, which describes what the method does, e.g.
PrintReceiptHeader. In its body write the code from the example below:
In the same way we'll create two more methods to print the middle part of the receipt (body)
PrintReceiptBody and to print the lower part of the receipt (footer)
After this we will create another method , which will invoke the three methods we already wrote, one after the other:
In the end we'll invoke the
PrintReceipt method from the body of the
Main method of our program:
The program with five methods, which invoke each other, is ready and we can run and test it, after which we can send it for testing in the judge system: https://judge.softuni.bg/Contests/Practice/Index/594#0.