fork(1) download
  1. package com.company;
  2. import java.util.*;
  3. import java.lang.*;
  4. import java.time.format.DateTimeFormatter;
  5. import java.time.LocalDateTime;
  6.  
  7. class SMS{
  8. Scanner kb= new Scanner(System.in);
  9. public int Product() {
  10. int i, total = 0, mrp,j=0;
  11. String ProductName[] = new String[]{"1.Whole Grain Breads Rs.40", "2.Brown Rice Wrape Rs.69/Kg", "3.Oats Rs.20", "4.Bulgur Rs.100", "5.Baking Soda Rs.50/kg", "6.Sea Sat Rs.10", "7.Natural Oil Rs.140/lit", "8.Catalyst Rs.55", "9.Green Tea Rs.69", "10.Coffee Rs.28"};
  12. int mrp[] = new int[]{40, 69, 20, 100, 50, 10, 140, 55, 69, 28} ;
  13. String ProductTopass[]= new String[10];
  14. System.out.println("The Product List Is as Follows\n");
  15. for (i=0;i<=9;i++) {
  16. System.out.println(ProductName[i]);
  17. }
  18. for (i = null; i != 0; i++) {
  19. i = kb.nextInt();
  20. ProductTopass[j]=ProductName[i];
  21. total += mrp[i];
  22. j++;
  23. }
  24.  
  25. }
  26. public void ShoppingBill ( int total,String ProductToPass[],int mrp[]){
  27. int i;
  28. DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss");
  29. LocalDateTime now = LocalDateTime.now();
  30. System.out.println("------------------------------------------");
  31. System.out.println("|\t\t JK Mart Private Limited |");
  32. System.out.println("| Add: Main Market Pimpri,Pimpri Chinchwad|\n|\t Contact No. 9876543210\t\t\t |");
  33. System.out.println("------------------------------------------");
  34. System.out.println("\t\t * Bill To Pay *");
  35. Random rand = new Random();
  36. System.out.print("To.Cash\t\t");
  37. System.out.printf("\t\t\tBill No:%04d%n", rand.nextInt(10000));
  38. System.out.print("\t\t Date & Time\n\t\t" + dtf.format(now));
  39. System.out.println("\n");
  40. System.out.println("--------------------------------------------");
  41. System.out.println("| No.|\tItem\t| Qty\t| Amount(In Rs.) |");
  42. for (i=null; i<= ProductToPass.length; i++)
  43. System.out.println("| 1 |\t"+ProductToPass[i]+"\t1\t"+mrp[].class" |");
  44. }
  45.  
  46. }
  47.  
  48. public class Super_Market_Managment_System {
  49. public static void main(String[] args) {
  50. Scanner kb= new Scanner(System.in);
  51. int ch;
  52. // String ProductName[] = new String[3];
  53. int Qyt[] = new int[3];
  54.  
  55. System.out.println("Please Enter Your Choice\n\t 1.Product List\n\t 2.Genrate Shopping Bill\n\t 3.New Bill\n\t 4.Exit");
  56. while (ch!=4) {
  57. ch = kb.nextInt();
  58. switch (ch) {
  59. case 1:
  60. Products();
  61. System.out.println("Enetr 2 to genrate Bill");
  62. ch = kb.nextInt();
  63. break;
  64. case 2:
  65. ShoppingBill();
  66. break;
  67. case 3:
  68. System.out.print("\033[H\033[2J");
  69. System.out.flush();
  70. ShoppingBill();
  71. break;
  72. case 4:
  73. System.out.println("Exiting...");
  74. break;
  75. }
  76. }
  77.  
  78. }
  79.  
  80. }
  81.  
  82.  
  83.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:43: error: ')' expected
            System.out.println("| 1  |\t"+ProductToPass[i]+"\t1\t"+mrp[].class" |");
                                                                              ^
1 error
stdout
Standard output is empty