Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

تمرین #2

Open
Armanneda opened this issue Sep 11, 2022 · 0 comments
Open

تمرین #2

Armanneda opened this issue Sep 11, 2022 · 0 comments

Comments

@Armanneda
Copy link

using System;

namespace Part2
{
class Program
{
static void Main(string[] args)
{
Student student = new Student();

        student.SetName("ali");
        student.SetSurname("amiri");
        student.SetPassword("Aa21354");
        student.SetAge(16);

        Console.WriteLine(student.GetRole());
        Console.WriteLine(student.GetName());
        Console.WriteLine(student.GetSurname());
        Console.WriteLine(student.GetAge());
        Console.WriteLine(student.GetName());
    }
}
class Student
{
    private string name;  //g s
    private string surname; //g s
    private int age; //g s
    private string role = "guest"; //g
    private string password; //s

    public void SetPassword(string value)
    {
        password = value;
    }

    //get
    public string GetRole()
    {
        return role;
    }

    //set
    public void SetName(string value)
    {
        name = value;
    }

    public string GetName()
    {
        return name;
    }


    public void SetSurname(string value)
    {
        surname = value;
    }

    public string GetSurname()
    {
        return surname;
    }

    public void SetAge(int value)
    {
        age = value;
    }

    public int GetAge()
    {
        return age;
    }

}

} @

``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant