Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace lectia1
- {
- class Timp
- {
- public int ora;
- public int min;
- public int sec;
- public Timp()
- {
- ora = 12;
- min = 23;
- sec = 37;
- }
- public Numar(int x)
- {
- ora = x;
- min = y;
- sec = z;
- }
- public Boolean EsteFix()
- {
- if(min == 0 && sec == 0)
- return true;
- else
- return false;
- }
- }
- class Numar //clasa
- {
- public int valoare;//data membru
- public Numar()//constructor
- {
- valoare = 5;
- }
- public Boolean Par()//metode
- {
- if(valoare%2 ==0)
- return true;
- else
- return false;
- }
- public Numar(int x)//constructor
- {
- valoare = x;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Timp x = new Timp();
- //x.valoare = 5;
- if(x.Par())
- Console.writeline(x.valoare+" par");
- else
- Console.WriteLine("impar");
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement