Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Parduotuves RastiBrangiausiaGamini(Parduotuves[] par, out int juvelyrikosIndeksas )
- {
- int[] prices = new int[ZiedaiCount];
- int parduotuvesIndeksas = 0;
- juvelyrikosIndeksas = 0 ;
- for (int i = 0; i < par.Length; i++)
- if (par[i] != null)
- {
- for (int j = 0; j < par[i].Gaminys.Length; j++) // ČIA IRGI RODĖ ERRORĄ, BET if (par[i] != null) SUTVARKĖ TAI
- {
- if (par[i].Gaminys[j].Price >
- par[parduotuvesIndeksas].Gaminys[juvelyrikosIndeksas].Price)
- {
- parduotuvesIndeksas = i;
- juvelyrikosIndeksas = j;
- }
- }
- }
- return par[parduotuvesIndeksas];
- }
- public static void SpausdintiZieda(Parduotuves par, int juvelyrikosIndeksas)
- {
- Console.WriteLine("------------------------------------------");
- Console.WriteLine("Brangiausias ziedas yra " + par.Title + "parduotuveje"); //ERRORĄ RODO ČIA
- Console.WriteLine("------------------------------------------");
- Console.WriteLine("{0,14} {1,10} {2,15} {3,10} {4,6} {5,9} {6,7}", "Manufacturer",
- "Name", "Material", "Weight", "Size", "Hallmark", "Price");
- Console.WriteLine("");
- Console.WriteLine("{0,14} {1,10} {2,13} {3,8} {4,8} {5,7} {6,8}",
- par.Gaminys[juvelyrikosIndeksas].Manufacturer, // 0
- par.Gaminys[juvelyrikosIndeksas].Name, // 1
- par.Gaminys[juvelyrikosIndeksas].Material, // 2
- par.Gaminys[juvelyrikosIndeksas].Weight, // 3
- par.Gaminys[juvelyrikosIndeksas].Hallmark, // 5
- par.Gaminys[juvelyrikosIndeksas].Price); // 6
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement