package com.company;
import java.util.*;
import java.lang.*;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;

class SMS{
    Scanner kb= new Scanner(System.in);
    public int Product() {
        int i, total = 0, mrp,j=0;
        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"};
        int mrp[] = new int[]{40, 69, 20, 100, 50, 10, 140, 55, 69, 28} ;
        String ProductTopass[]= new String[10];
        System.out.println("The Product List Is as Follows\n");
        for (i=0;i<=9;i++) {
            System.out.println(ProductName[i]);
        }
        for (i = null; i != 0; i++) {
            i = kb.nextInt();
           ProductTopass[j]=ProductName[i];
            total += mrp[i];
            j++;
        }

    }
        public void ShoppingBill ( int total,String ProductToPass[],int mrp[]){
        int i;
            DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss");
            LocalDateTime now = LocalDateTime.now();
            System.out.println("------------------------------------------");
            System.out.println("|\t\t JK Mart Private Limited          |");
            System.out.println("| Add: Main Market Pimpri,Pimpri Chinchwad|\n|\t   Contact No. 9876543210\t\t\t  |");
            System.out.println("------------------------------------------");
            System.out.println("\t\t * Bill To Pay *");
            Random rand = new Random();
            System.out.print("To.Cash\t\t");
            System.out.printf("\t\t\tBill No:%04d%n", rand.nextInt(10000));
            System.out.print("\t\t   Date & Time\n\t\t" + dtf.format(now));
            System.out.println("\n");
            System.out.println("--------------------------------------------");
            System.out.println("| No.|\tItem\t|   Qty\t|   Amount(In Rs.) |");
            for (i=null; i<= ProductToPass.length; i++)
            System.out.println("| 1  |\t"+ProductToPass[i]+"\t1\t"+mrp[].class" |");
        }

}

public class Super_Market_Managment_System {
    public static void main(String[] args) {
        Scanner kb= new Scanner(System.in);
        int ch;
//        String ProductName[] = new String[3];
        int Qyt[] = new int[3];

            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");
        while (ch!=4) {
            ch = kb.nextInt();
            switch (ch) {
                case 1:
                    Products();
                    System.out.println("Enetr 2 to genrate Bill");
                    ch = kb.nextInt();
                    break;
                case 2:
                    ShoppingBill();
                    break;
                case 3:
                    System.out.print("\033[H\033[2J");
                    System.out.flush();
                    ShoppingBill();
                    break;
                case 4:
                    System.out.println("Exiting...");
                    break;
            }
        }

        }

    }


