By GokiSoft.com| 15:56 28/10/2021|
C Sharp

[Examination] C# - Chương trình quản lý đội thi TechWiz toàn cầu Apptech Ấn Độ - C#

Trong cuộc thi Techwiz toàn cầu do Aptech Ấn Độ tổ chức. Có rất nhiều các đội ở các trung tâm Aptech trên toàn cầu cùng tham gia. Bạn được yêu cầu viết chương trình quản lý thông tin đội chơi và thông tin dự án của từng đội.

Yêu cầu:

1) Tạo lớp đối tượng Project gồm các trường thông tin: string name (tên đề tài), string projectType: Nhóm dự án (group chỉ nhận 3 giá trị là Development & Design Website, Website Developer, Application Developer) - 1 điểm

2) Tạo lớp đối tượng Group gồm các thuộc tính: string name (tên nhóm), string center: tên trung tâm aptech, project (kiểu dữ liệu là Project) - 1 điểm

Viết getter/setter cho tất cả các thuộc tính của lớp đối tượng - 1 điểm

Viết hàm Input, Display của đối tượng trên - 2 điểm

Tạo class Program có chưa 1 method Main. Yêu cầu khai báo mảng List<Group> groupList. Yêu cầu nhập vào ngẫu nhiên N nhóm (N có giá trị từ 2 tới 10) - 5 điểm

Tạo 1 delegate như sau

delegate void ShowInfor();

Khai báo 1 đối tượng delegate ShowInfor -> Thực hiện quản lý tất cả các phương thức Display() của tất cả các đối tượng Project trong đối tượng này. Yêu cầu gọi thực thi delegate vừa được tạo ra.  - 5 điểm





Phản hồi từ học viên

5

(Dựa trên đánh giá ngày hôm nay)

Đỗ Minh Quân [T2008A]
Đỗ Minh Quân

2021-06-04 09:35:12



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;

namespace TechwizProject
{
    class Group
    {
        
        public string Name { get; set; }

        public string Center { get; set; }

        public string Project { get; set; }


        public Group() { }

        public Group(string Name, string Center, string Project)
        {
            this.Name = Name;
            this.Center = Center;
            this.Project = Project;
        }

        public void Input()
        {
            Console.WriteLine("Nhap ten cua ban:");
            Name = Console.ReadLine();

            Console.WriteLine("Nhap trung tam aptech:");
            Center = Console.ReadLine();

            Console.WriteLine("Nhap ten project:");
            Project = Console.ReadLine();


        }


        public void Display()
        {
            Console.WriteLine("Name: {0}, Center: {1}, Project: {2}",  Name, Center, Project);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace TechwizProject
    {
        class Program
        {
            public delegate void ShowInfor();
            public string Name { get; set; }
            public string Center { get; set; }
            public object Project { get; set; }
            List<string> Group = new List<string>();
            private static int a;

            static void Main(string[] args)
            {
                while (true)
                {
                    Console.WriteLine("Nhập so n: ");
                    int a = 2;
                    try
                    {
                        a = Int32.Parse(Console.ReadLine());
                        
                        if (a >= 2 && a <= 10) 

                            break;

                        else Console.WriteLine("Nhap lai a");
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("Yeu cau nhap lai a ");
                    }
                }
                for (int i = 0; i<a; i++)
                {
                    input();
                }


            }

            public void input()
            {
                Console.WriteLine("Nhap ten cua ban:");
                Name = Console.ReadLine();

                Console.WriteLine("Nhap trung tam aptech:");
                Center = Console.ReadLine();

                Console.WriteLine("Nhap ten project:");
                Project = Console.ReadLine();
            }
        }


    }

#phan2



Đức Sơn [T2008A]
Đức Sơn

2021-06-04 09:34:27

Program

using System;

using System.Collections.Generic;


namespace TechWiz

{

    

    class Program

    {

        public delegate void showInfor();

        static void Main(string[] args)

        {

            List<showInfor> list = new List<showInfor>();

            List<Group> groupList = new List<Group>();

            Console.WriteLine("So nhom muon nhap:");

            int N = int.Parse(Console.ReadLine());

            for (int i = 1; i <= N; i++)

            {

                Group group = new Group();

                group.Input();

                groupList.Add(group);

                list.Add(group.project.Display);

            }

            foreach (showInfor s in list)

            {

                s();

            }

        }

    }

}



Đức Sơn [T2008A]
Đức Sơn

2021-06-04 09:33:43

Group
using System;

namespace TechWiz
{
    class Group
    {
        public string name { get; set; }
        public string center { get; set; }
        public Project project { get; set; }
        public Group()
        {

        }
        public void Input()
        {
            Console.WriteLine("Ten nhom:");
            name = Console.ReadLine();
            Console.WriteLine("Ten trung tam:");
            center = Console.ReadLine();
            project = new Project();
            project.Input();
        }
        public void Display()
        {
            Console.WriteLine("Ten nhom: {0}", name);
            Console.WriteLine("Ten trung tam: {0}", center);
            project.Display();
        }
    }
}


Nguyễn Tiến Đạt [T2008A]
Nguyễn Tiến Đạt

2021-06-04 09:33:36

Lý thuyết


Vũ Đình Khôi [community,T2008A]
Vũ Đình Khôi

2021-06-04 09:33:12

lý thuyết


thực hành

#Program.cs


using System;
using System.Collections.Generic;

namespace TechWiz
{
    
    class Program
    {
        public delegate void showInfor();
        static void Main(string[] args)
        {
            List<showInfor> list = new List<showInfor>();
            List<Group> groupList = new List<Group>();
            Console.WriteLine("So nhom muon nhap:");
            int N = int.Parse(Console.ReadLine());
            for (int i = 1; i <= N; i++)
            {
                Group group = new Group();
                group.Input();
                groupList.Add(group);
                list.Add(group.project.Display);
            }
            foreach (showInfor s in list)
            {
                s();
            }
        }
    }
}


#Group.cs


using System;

namespace TechWiz
{
    class Group
    {
        public string name { get; set; }
        public string center { get; set; }
        public Project project { get; set; }
        public Group()
        {

        }
        public void Input()
        {
            Console.WriteLine("Ten nhom:");
            name = Console.ReadLine();
            Console.WriteLine("Ten trung tam:");
            center = Console.ReadLine();
            project = new Project();
            project.Input();
        }
        public void Display()
        {
            Console.WriteLine("Ten nhom: {0}", name);
            Console.WriteLine("Ten trung tam: {0}", center);
            project.Display();
        }
    }
}


#Project.cs


using System;

namespace TechWiz
{
    class Project
    {
        public string name { get; set; }
        public string group { get; set; }
        public Project()
        {

        }
        public void Input()
        {
            Console.WriteLine("Ten de tai:");
            name = Console.ReadLine();
            Console.WriteLine("Chon 1 trong 3 nhom:");
            Console.WriteLine("1.Development & Design Website");
            Console.WriteLine("2.Website Developer");
            Console.WriteLine("3.Application Developer");
            int chon = int.Parse(Console.ReadLine());
            if(chon == 1)
            {
                group = "Development & Design Website";
            }
            if(chon == 2)
            {
                group = "Website Developer";
            }
            if(chon == 3)
            {
                group = "Application Developer";
            }
        }
        public void Display()
        {
            Console.WriteLine("Ten de tai: {0}", name);
            Console.WriteLine("Nhom du an: {0}", group);
        }
    }
}



Đỗ Minh Quân [T2008A]
Đỗ Minh Quân

2021-06-04 09:33:11



using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;

namespace TechwizProject
{
    class Project 
        {
         public string Name { get; set; }
         public string Group { get; set; }

        string Group = "Development & Design Website, Website Developer, Application Developer";
    }

#phan1



Do Trung Duc [T2008A]
Do Trung Duc

2021-06-04 09:30:15


Ly thuyet - Do Trung Duc



Vũ Đình Khôi [community,T2008A]
Vũ Đình Khôi

2021-06-04 09:28:13

lý thuyết



using System;

namespace TechWiz
{
    class Group
    {
        public string name { get; set; }
        public string center { get; set; }
        public Project project { get; set; }
        public Group()
        {

        }
        public void Input()
        {
            Console.WriteLine("Ten nhom:");
            name = Console.ReadLine();
            Console.WriteLine("Ten trung tam:");
            center = Console.ReadLine();
            project = new Project();
            project.Input();
        }
        public void Display()
        {
            Console.WriteLine("Ten nhom: {0}", name);
            Console.WriteLine("Ten trung tam: {0}", center);
            project.Display();
        }
    }
}
using System;

namespace TechWiz
{
    class Project
    {
        public string name { get; set; }
        public string group { get; set; }
        public Project()
        {

        }
        public void Input()
        {
            Console.WriteLine("Ten de tai:");
            name = Console.ReadLine();
            Console.WriteLine("Chon 1 trong 3 nhom:");
            Console.WriteLine("1.Development & Design Website");
            Console.WriteLine("2.Website Developer");
            Console.WriteLine("3.Application Developer");
            int chon = int.Parse(Console.ReadLine());
            if(chon == 1)
            {
                group = "Development & Design Website";
            }
            if(chon == 2)
            {
                group = "Website Developer";
            }
            if(chon == 3)
            {
                group = "Application Developer";
            }
        }
        public void Display()
        {
            Console.WriteLine("Ten de tai: {0}", name);
            Console.WriteLine("Nhom du an: {0}", group);
        }
    }
}
using System;
using System.Collections.Generic;

namespace TechWiz
{
    
    class Program
    {
        public delegate void showInfor();
        static void Main(string[] args)
        {
            List<showInfor> list = new List<showInfor>();
            List<Group> groupList = new List<Group>();
            Console.WriteLine("So nhom muon nhap:");
            int N = int.Parse(Console.ReadLine());
            for (int i = 1; i <= N; i++)
            {
                Group group = new Group();
                group.Input();
                groupList.Add(group);
                list.Add(group.project.Display);
            }
            foreach (showInfor s in list)
            {
                s();
            }
        }
    }
}



Nguyễn đình quân [T2008A]
Nguyễn đình quân

2021-06-04 09:28:07


#Program.cs


using System;
using System.Collections.Generic;

namespace TechWiz
{
    
    class Program
    {
        public delegate void showInfor();
        static void Main(string[] args)
        {
            List<showInfor> list = new List<showInfor>();
            List<Group> groupList = new List<Group>();
            Console.WriteLine("So nhom muon nhap:");
            int N = int.Parse(Console.ReadLine());
            for (int i = 1; i <= N; i++)
            {
                Group group = new Group();
                group.Input();
                groupList.Add(group);
                list.Add(group.project.Display);
            }
            foreach (showInfor s in list)
            {
                s();
            }
        }
    }
}



Nguyễn Anh Vũ [T2008A]
Nguyễn Anh Vũ

2021-06-04 09:26:41

#Project


using System;
using System.Collections.Generic;
using System.Text;

namespace Examination2312
{
    class Project
    {
        public string Name { get; set; }
        public string Group { get; set; }

        public Project()
        {

        }

        public Project(string Name, string Group)
        {
            this.Name = Name;
            this.Group = Group;
        }

        public void input()
        {
            Console.WriteLine("Ten de tai:");
            Name = Console.ReadLine();
            Console.WriteLine("Chon 1 trong 3 nhom:");
            Console.WriteLine("1.Development & Design Website");
            Console.WriteLine("2.Website Developer");
            Console.WriteLine("3.Application Developer");
            int chon = int.Parse(Console.ReadLine());
            if (chon == 1)
            {
                Group = "Development & Design Website";
            }
                
            if(chon == 2)
            {
                Group = "Website Developer";
            }
            if(chon == 3)
            {
                Group = "Application Developer";
            }
        }

        public void display()
        {
            Console.WriteLine("Name: = {0}", Name);
            Console.WriteLine("Group: = {0}", Group);
        }
    }
}


#Group
using System;
using System.Collections.Generic;
using System.Text;

namespace Examination2312
{
    class Group
    {
        public string Name { get; set; }
        public string Center { get; set; }
        public Project project { get; set; }


        public Group() { }

        public Group(string Name, string Center)
        {
            this.Name = Name;
            this.Center = Center;
        }

        public void input()
        {
            Console.WriteLine("Nhap Name: ");
            Name = Console.ReadLine();
            Console.WriteLine("Nhap Center: ");
            Center = Console.ReadLine();
            project = new Project();
        
        }

        public void display()
        {
            Console.WriteLine("Name: = {0}", Name);
            Console.WriteLine("Center: = {0]", Center);
           
        }
    }
}
#Program


using System;
using System.Collections.Generic;

namespace Examination2312
{
    class Program
    {
        public delegate void showInfor();
        static void Main(string[] args)
        {
            List<showInfor> list = new List<showInfor>();
            List<Group> groupList = new List<Group>();
            Console.WriteLine("So nhom muon nhap:");
            int N = int.Parse(Console.ReadLine());
            for (int i = 1; i <= N; i++)
            {
                Group group = new Group();
                groupList.Add(group);
            }
            foreach (showInfor s in list)
            {
                s();
            }
        }
    }
}



Đăng nhập để làm bài kiểm tra

Chưa có kết quả nào trước đó