Advertisement
Stojanov2017

1.Zadatak uspeh

Sep 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         enum Uspeh { nedovoljan=1, dovoljan, dobar, vrlo_dobar, odlican };
  11.         static void Main(string[] args)
  12.         {
  13.             string s;
  14.             int o;
  15.  
  16.             Console.WriteLine("Unesi uspeh:");
  17.             s = Console.ReadLine();
  18.  
  19.        switch (s) {
  20.            
  21.             case "nedovoljan":    
  22.                 Console.WriteLine("Ocena je: "+ Convert.ToInt32(Uspeh.nedovoljan));
  23.                 break;
  24.  
  25.             case "dovoljan":
  26.                  Console.WriteLine("Ocena je: "+ Convert.ToInt32(Uspeh.dovoljan));
  27.                  break;
  28.  
  29.             case "dobar":
  30.                  Console.WriteLine("Ocena je: "+ Convert.ToInt32(Uspeh.dobar));
  31.                 break;
  32.  
  33.             case "vrlo_dobar":
  34.                 Console.WriteLine("Ocena je: "+ Convert.ToInt32(Uspeh.vrlo_dobar));
  35.                 break;
  36.  
  37.             case "odlican":
  38.                 Console.WriteLine("Ocena je: " + Convert.ToInt32(Uspeh.odlican));
  39.                 break;              
  40.             }
  41.            
  42.             Console.ReadLine();
  43.            
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement