printhardcodedupdated

 avatar
chamanEiqbal
java
a year ago
2.3 kB
8
Indexable
Never
 System.out.println("\n\n\n");
    System.out.println("***********************************************************************************************************************************");
    System.out.printf("%82s","KARACHI AUTOSERVICES PVT. LTD.\n");
    System.out.println("***********************************************************************************************************************************");
    System.out.printf("Customer Name: %-40s","MUSTAFA"); // customername);
    System.out.printf("%60s %s\n", "Vehicle No.: ", "ABC999");
    System.out.printf("Contact No.: %-40s", "03001234567");
    System.out.printf("%64s %s\n", "Vehicle Model: ", "TOYOTA");
    System.out.println("***********************************************************************************************************************************");
    System.out.printf("%75s", "BILL DESCRIPTION: \n");
    System.out.println("***********************************************************************************************************************************");
    System.out.printf("%-20s%-40s%-20s%-20s%-20s%-20s\n", "Type", "Name", "Price", "Quantity", "Discount","Total");
    System.out.println("-----------------------------------------------------------------------------------------------------------------------------------");   
    System.out.printf("%-20s%-40s%15.2f%15.2f%15.2s%20.2f\n", "Labour", "Labour Charges for Servies etc", 155.5, 2.0, "-", 300.02);
    System.out.printf("%-20s%-40s%15.2f%15.2f%15.2s%20.2f\n", "Labour", "Labour Charges for Servies etc", 155.5, 2.0, "-", 300.02);
    System.out.printf("%-20s%-40s%15.2f%15.2f%15.2s%20.2f\n", "Labour", "Labour Charges for Servies etc", 155.5, 2.0, "-", 300.02);
    System.out.println("-----------------------------------------------------------------------------------------------------------------------------------");  
    System.out.printf("%-80s%45.2f\n", "Parts Total:", 55.5);
    System.out.printf("%-80s%45.2f\n", "Service Tax (5%):", 5.55);
    System.out.printf("%-80s%45.2f\n", "Labour Total:", 5.25);
    System.out.printf("%-80s%45.2f\n", "Grand Total:", 65.55);
    
    System.out.println("***********************************************************************************************************************************");