K4/D zad. A: 1. Zadeklarować funkcję a. We: tablica liczb całkowitych, b. Wy: min i max z tablicy 2. Program główny: a. We: pytać o liczbę ocen (oceny całkowite <1, 6> - test) b. wczytać oceny do tablicy c. uŝyć funkcji do zliczenia liczby ocen najlepszych i najgorszych pokazać ile i jaka najlepsza/najgorsza Partyniewicz 3,5 namespace ZadanieKoloPP static void szukaj(ref int[] tab, int n, out int max, out int min) max = tab[0]; min = tab[0]; for (int k = 0; k < n; k++) if (max < tab[k]) max = tab[k]; if (min > tab[k]) min = tab[k]; Komentarz: po co? Console.Write("Podaj ile chcesz wpisac ocen: "); int n, maxo, mino; n = Convert.ToInt32(Console.ReadLine()); int[] Oceny = new int[n]; for (int i = 0; i < n; i++) Console.WriteLine("Podaj Ocene0: ", i + 1); Oceny[i] = Convert.ToInt32(Console.ReadLine()); while (Oceny[i] < 1 && Oceny[i] > 6) Oceny[i] = Convert.ToInt32(Console.ReadLine()); szukaj(ref Oceny, n, out maxo, out mino); Console.WriteLine("MaxO = 0 MinO = 1", maxo, mino); Komentarz: test n! Komentarz: a jak n<0? Komentarz: test liczby! Komentarz: lub!! Komentarz: zliczać liczbę!!!
Dombrowski 2.0 namespace Kolokwium35 static void Oceny (int[] tab, out int n, out int min, out int max) max = tab[0] min = min[0] Komentarz: no i???? Console.Write("Podaj Liczbe Ocen"); int n, LiczbaOcen, Oceny, MinOcena, MaxOcena; n = Convert.ToInt32(Console.ReadLine()); int[] LiczbaOcen = new int[n]; for (int i = 0; i <n; i++) Console.WriteLine("Podaj Ocene"); Oceny[i] = Convert.ToInt32(Console.ReadLine()); while Oceny[i] <6 && Oceny[i] > 0) Komentarz:? Komentarz:?
Nawrocki 3.0 static void czytaj(out int njal, out int najg, out int [] tab,int n) najl = tab[0]; najg =tab[0]; for (int k = 0; k < n; k++) if (najl < tab[k]) najl = tab[k]; if (najg > tab[k]) najg = tab[k]; int n,oceny; Console.WriteLine("podaj liczbe ocen"); n=convert.toint32(console.readline()); int [] oceny =new int [n]; for (int i=oceny;i<n;i++) Console.WriteLine("podaj oceny "); oceny[i]=convert.toint32(console.readline()); while(oceny[i]<1 && ceny[i]>6) oceny[i] = Convert.ToInt32(Console.ReadLine()); czytaj(out int najg, out int najl, out int[] tab, int n) Console.WriteLine(" Komentarz: test liczby Komentarz:? n<0?? Komentarz: test liczby Komentarz: lub Komentarz: test liczby Komentarz: bez int, brak deklaracji argumentów
Nyka 2,0 static void Oceny(double[] TablOcen, out double min, out double max) int i, n, ocena; Console.WriteLine(TablOcen.Length); Console.WriteLine("Podaj liczbę ocen "); n = Console.ReadLine(); Console.WriteLine("Podaj oceny "); ocena = i = Console.ReadLine(); for (i = 0; 1 <= i >= 6; i++) else TablOcen = i;???? Console.Write("Błędna wartość!"); Komentarz: a program?? Tomczak 2.0 static void oceny(out int[] tablica,out int min,out int max) min = tablica[i]; max = tablica[i]; max = 6; min = 1; Komentarz: co to robi?? int Locen, ocena; Console.WriteLine("Podaj liczbe ocen ");
Locen = Console.ReadLine(); for (int i = 0; i < Locen; i++) Console.WriteLine("podaj ocene0: ", i + 1); ocena = Convert.ToInt32(Console.ReadLine()); Komentarz: a zgodność typów?? Komentarz: moŝe jakiś blok? Komentarz: tablica? Filipek 2.0 namespace MateuszFilipekKolo20_01_2010 static void tab(ref double[] t) int i, n; double liczby; for (i = 0; i < n; i++) Console.Write("Podaj 0 liczby: ", i + 1); while (!Double.TryParse(Console.ReadLine(), out liczby) liczby < 1 liczby > 6) Console.WriteLine("Podane liczby nie sa z przedzialu 1 do 6!!"); tab[i] = liczby; double[] tab; int i, n; double suma, max, min; Console.Write("Ile ma być ocen?"); while (!Int.TryParse(Console.ReadLine(), out n) n < 1); Console.WriteLine("Wprowadz raz jeszcze!"); tablica_liczby = new double[n]; ta for (i=0; i>n; i++); Komentarz: mało! Komentarz: brak deklaracji Komentarz: temat zadania był inny Komentarz: gdzie deklaracja?
Nakielski -3 static void funkcja(ref double[] tab) int i, n = tab.length; double ocena; for (i = 0; i < n; i++) Console.WriteLine("podaj 0 ocene)", i + 1); while (Double.TryParse(Console.ReadLine(), out ocena) ocena >= 1 ocena <= 6) ; Console.WriteLine("podana ocena nie moze byc z przedzialu innego niz 1 do 6"); ocena = tab[i]; Console.WriteLine("Ile bedzie ocen"); int max, min, n; while (!int.tryparse(console.readline(), out n) n > 1) ; ConsoleWriteLine("wprowadz prawidlowa wartosc ocen"); tablicaocen = new double[n]; Komentarz: mało Komentarz: to nie ta funkcja Komentarz: brak deklaracji funkcja(ref tablicaocen); Console.Clear(); for (i = 0; i < n; i++) Console.ReadLine("Ocena 0", tablicaocen[i]); max = tab[0]; min = tab[0]; for (int k = 0; k < n; k++) if (max < tab[k]) max = tab[k]; if (min > tab[k]) min = tab[k];
Console.WriteLine("najnizszych ocen bylo 0", min); Console.WriteLine("najwyzszych ocen bylo 0", max); Komentarz: to wartości min i max nie ilości!!! Deka 2.0 int ocena1, ocena2, ocena3, ocena4, ocena5, ocena6, ocena7, ocena8, ocena9, ocena10, i; Console.WriteLine("Podaj ocene 1"); while ((Int32.TryParse(Console.ReadLine(), out ocena1)) (ocena1 >= 6 && ocena1 <= 0)) Console.WriteLine("Złe dane"); sr = ((ocena1 + ocena2 + ocena3 + ocena4 + ocena5 + ocena6 + ocena7 + ocena8 + ocena9 + ocena10) / 2); if (ocena1 < sr) Console.WriteLine ("ocena dobra") else Console.WriteLine("Ocena zła");