File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed
Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -22,19 +22,26 @@ static void Add(String line){
2222 }
2323
2424 static void ShowBucket (){
25-
25+ double orderValue = 0.0 ;
26+ ;
27+
2628
2729 for (int i = 0 ; i <ProductData .products .size (); i ++){
2830 for (int j =0 ; j < productsNumberArray .length ; j ++ ){
29-
31+
3032 if (ProductData .products .get (i ).id == productsNumberArray [j ] ){
31- System .out .println (ProductData .products . get (i ).prodName );
33+
34+ System .out .println (ProductData .products .get (i ).prodName + " ---> " + ProductData .products .get (i ).price + " zł" );
35+ orderValue += ProductData .products .get (i ).price ;
36+
3237 }
3338 }
34-
35-
39+
3640 }
3741
42+ System .out .println (" " );
43+ System .out .println ("Wartość koszyka ---> " + orderValue + " zł" );
44+
3845 }
3946
4047}
Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ static void printMainMenu(){
99 System .out .println (" " );
1010 System .out .println ("*** MENU ***" );
1111 System .out .println ("(1) Pokaż wszystkie produkty" );
12- System .out .println ("(2) Filtruj produkty" );
13- System .out .println ("(3) Zamknij sklep!" );
12+ System .out .println ("(2) Zamknij sklep!" );
1413 System .out .println (" " );
1514 }
1615
@@ -63,7 +62,8 @@ static void printSubMenu(Scanner scanner){
6362 AddProductToBucket .Add (numbersLine );
6463
6564 System .out .println (" " );
66- ClearConsole .Clean ();
65+ System .out .println (" " );
66+
6767 System .out .println ("Twój koszyk: " );
6868 AddProductToBucket .ShowBucket ();
6969
You can’t perform that action at this time.
0 commit comments