Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Pj_PrakticniVezbe2
- {
- class Fakultet
- {
- String naziv;
- public String Naziv
- {
- get { return naziv; }
- set { naziv = value; }
- }
- List<Student> spisakStudenata;
- public List<Student> SpisakStudenata
- {
- get { return spisakStudenata; }
- set { spisakStudenata = value; }
- }
- //setace kroz klase pa cemo da je stavimo na static
- public static Ispit ucitajIspit()
- {
- Console.WriteLine("Unesite predmet: \n");
- String predmet = Console.ReadLine();
- //skracenica za cwl je cw tab tab
- Console.WriteLine("Unesite ime \n");
- String ime = Console.ReadLine();
- Console.WriteLine("Unesite prezime ");
- String prezime = Console.ReadLine();
- Console.WriteLine("Unesite broj radne knjizice");
- String brojRadneKnjizice = Console.ReadLine();
- Profesor p = new Profesor(ime, prezime, brojRadneKnjizice);
- Console.WriteLine("Unesite datum \n");
- DateTime datum = Convert.ToDateTime(Console.ReadLine());
- int ocena = 0;
- int brojac = 0;
- while (brojac < 4)
- {
- try
- {
- Console.WriteLine("Unesite ocenu: \n");
- ocena = Convert.ToInt32(Console.ReadLine());
- break;
- ///ako ne uspe da konvertuje skace u catch i vraca nas u while petlju
- }
- catch (Exception)
- {
- Console.WriteLine("Niste uneli broj");
- }
- }
- Ispit unos = new Ispit(predmet, p, datum, ocena);
- return unos;
- }
- public static Student ucitajStudenta()
- {
- Console.WriteLine("Unesite ime \n");
- String ime = Console.ReadLine();
- Console.WriteLine("Unesite prezime \n");
- String prezime = Console.ReadLine();
- Console.WriteLine("Unesite broj indeksa \n");
- String brojIndeksa = Console.ReadLine();
- // Console.WriteLine("Unesi status \n");
- //ne vidi statis
- // Status stat = (Status)stat.ParseEnum.Console.ReadLine();
- Student s = new Student(ime, prezime, brojIndeksa);
- bool kraj = true;
- while (kraj)
- {
- Console.WriteLine("Zelite li da unesete ispit. Odgovorite sa DA ili NE");
- switch(Console.ReadLine().ToUpper())
- {
- //sudent ima metodu polozen ispit 6 metoda prima parametar ucitaj ispit pa nju prosledjujemo toj polozen ispit
- //ne mogu da vidim metodu iz nekog razloga
- case "DA": Fakultet.ucitajIspit(); break;
- case "NE": break;
- default: kraj = false; break ;
- }
- }
- return s;
- }
- static void Main(string[] args)
- {
- Fakultet f = new Fakultet();
- f.spisakStudenata.Add(Fakultet.ucitajStudenta());
- f.spisakStudenata.Add(Fakultet.ucitajStudenta());
- foreach (Student s in f.spisakStudenata)
- {
- Console.WriteLine("Prikazi naziv");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement