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} ;
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 *"); 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("--------------------------------------------"); 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"); ShoppingBill();
break;
case 4:
System.
out.
println("Exiting..."); break;
}
}
}
}
cGFja2FnZSBjb20uY29tcGFueTsKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLnRpbWUuZm9ybWF0LkRhdGVUaW1lRm9ybWF0dGVyOwppbXBvcnQgamF2YS50aW1lLkxvY2FsRGF0ZVRpbWU7CgpjbGFzcyBTTVN7CiAgICBTY2FubmVyIGtiPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwogICAgcHVibGljIGludCBQcm9kdWN0KCkgewogICAgICAgIGludCBpLCB0b3RhbCA9IDAsIG1ycCxqPTA7CiAgICAgICAgU3RyaW5nIFByb2R1Y3ROYW1lW10gPSBuZXcgU3RyaW5nW117IjEuV2hvbGUgR3JhaW4gQnJlYWRzIFJzLjQwIiwgIjIuQnJvd24gUmljZSBXcmFwZSBScy42OS9LZyIsICIzLk9hdHMgUnMuMjAiLCAiNC5CdWxndXIgUnMuMTAwIiwgIjUuQmFraW5nIFNvZGEgUnMuNTAva2ciLCAiNi5TZWEgU2F0IFJzLjEwIiwgIjcuTmF0dXJhbCBPaWwgUnMuMTQwL2xpdCIsICI4LkNhdGFseXN0IFJzLjU1IiwgIjkuR3JlZW4gVGVhIFJzLjY5IiwgIjEwLkNvZmZlZSBScy4yOCJ9OwogICAgICAgIGludCBtcnBbXSA9IG5ldyBpbnRbXXs0MCwgNjksIDIwLCAxMDAsIDUwLCAxMCwgMTQwLCA1NSwgNjksIDI4fSA7CiAgICAgICAgU3RyaW5nIFByb2R1Y3RUb3Bhc3NbXT0gbmV3IFN0cmluZ1sxMF07CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJUaGUgUHJvZHVjdCBMaXN0IElzIGFzIEZvbGxvd3NcbiIpOwogICAgICAgIGZvciAoaT0wO2k8PTk7aSsrKSB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihQcm9kdWN0TmFtZVtpXSk7CiAgICAgICAgfQogICAgICAgIGZvciAoaSA9IG51bGw7IGkgIT0gMDsgaSsrKSB7CiAgICAgICAgICAgIGkgPSBrYi5uZXh0SW50KCk7CiAgICAgICAgICAgUHJvZHVjdFRvcGFzc1tqXT1Qcm9kdWN0TmFtZVtpXTsKICAgICAgICAgICAgdG90YWwgKz0gbXJwW2ldOwogICAgICAgICAgICBqKys7CiAgICAgICAgfQoKICAgIH0KICAgICAgICBwdWJsaWMgdm9pZCBTaG9wcGluZ0JpbGwgKCBpbnQgdG90YWwsU3RyaW5nIFByb2R1Y3RUb1Bhc3NbXSxpbnQgbXJwW10pewogICAgICAgIGludCBpOwogICAgICAgICAgICBEYXRlVGltZUZvcm1hdHRlciBkdGYgPSBEYXRlVGltZUZvcm1hdHRlci5vZlBhdHRlcm4oImRkL01NL3l5eXkgSEg6bW06c3MiKTsKICAgICAgICAgICAgTG9jYWxEYXRlVGltZSBub3cgPSBMb2NhbERhdGVUaW1lLm5vdygpOwogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSIpOwogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oInxcdFx0IEpLIE1hcnQgUHJpdmF0ZSBMaW1pdGVkICAgICAgICAgIHwiKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJ8IEFkZDogTWFpbiBNYXJrZXQgUGltcHJpLFBpbXByaSBDaGluY2h3YWR8XG58XHQgICBDb250YWN0IE5vLiA5ODc2NTQzMjEwXHRcdFx0ICB8Iik7CiAgICAgICAgIC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IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgICBpbnQgY2g7Ci8vICAgICAgICBTdHJpbmcgUHJvZHVjdE5hbWVbXSA9IG5ldyBTdHJpbmdbM107CiAgICAgICAgaW50IFF5dFtdID0gbmV3IGludFszXTsKCiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiUGxlYXNlIEVudGVyIFlvdXIgQ2hvaWNlXG5cdCAxLlByb2R1Y3QgTGlzdFxuXHQgMi5HZW5yYXRlIFNob3BwaW5nIEJpbGxcblx0IDMuTmV3IEJpbGxcblx0IDQuRXhpdCIpOwogICAgICAgIHdoaWxlIChjaCE9NCkgewogICAgICAgICAgICBjaCA9IGtiLm5leHRJbnQoKTsKICAgICAgICAgICAgc3dpdGNoIChjaCkgewogICAgICAgICAgICAgICAgY2FzZSAxOgogICAgICAgICAgICAgICAgICAgIFByb2R1Y3RzKCk7CiAgICAgICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJFbmV0ciAyIHRvIGdlbnJhdGUgQmlsbCIpOwogICAgICAgICAgICAgICAgICAgIGNoID0ga2IubmV4dEludCgpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAyOgogICAgICAgICAgICAgICAgICAgIFNob3BwaW5nQmlsbCgpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAzOgogICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoIlwwMzNbSFwwMzNbMkoiKTsKICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LmZsdXNoKCk7CiAgICAgICAgICAgICAgICAgICAgU2hvcHBpbmdCaWxsKCk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlIDQ6CiAgICAgICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJFeGl0aW5nLi4uIik7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIH0KCiAgICB9CgoK