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)

Bùi Văn Mạnh [T2008A]
Bùi Văn Mạnh

2021-06-04 09:11:34



Lý Thuyết 60%



Đỗ Mạc Nam [T2008A]
Đỗ Mạc Nam

2021-06-04 09:10:00


#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);
        }
    }
}



Đỗ Mạc Nam [T2008A]
Đỗ Mạc Nam

2021-06-04 09:09:52


#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();
        }
    }
}



Đỗ Mạc Nam [T2008A]
Đỗ Mạc Nam

2021-06-04 09:09:41


#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();
            }
        }
    }
}



Do Trung Duc [T2008A]
Do Trung Duc

2021-06-04 09:08:05



using System;
using System.Collections.Generic;

namespace ExamFinal

{

    
    class Program
    {
        public delegate void ShowInfor();
        static List<Group> ListGroup = new List<Group>();
        static void Main(string[] args)
        {
            List<Group> ListGroup = new List<Group>();
            Console.WriteLine("Nhap so luong nhom muon them:");
            int N = Int32.Parse(Console.ReadLine());
            for(int i = 0; i < N; i++)
            {   
                Console.WriteLine("Nhap thong tin nhom thu {0}", i + 1);
                Group group = new Group();
                group.Input();
                ListGroup.Add(group);
            }

            Console.WriteLine("Thong tin tat ca cac du an tham gia cuoc thi nhu sau:");
            ShowInfor showInfor = new ShowInfor(DisplayAllProject);
            showInfor();
        }

        static void DisplayAllProject()
        {
              foreach(Group group in ListGroup)
            {
                group.Project.Display();
            }
        }
    }
}



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

2021-06-04 08:59:03


#Group.cs


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

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}, Ten trung tam: {1}", name, center);
            project.Display();
        }
    }
}


#Program.cs


using System;
using System.Collections.Generic;

namespace TechWiz
{
    
    class Program
    {
        public delegate void showInfor();
        static void Main(string[] args)
        {
            List<showInfor> inforProjectList = new List<showInfor>();
            List<Group> groupList = new List<Group>();
            Random random = new Random();
            int N = random.Next(2, 10);
            Console.WriteLine("Nhap thong tin cho {0} nhom ngau nhien:", N);
            for (int i = 0; i < N; i++)
            {
                Group group = new Group();
                Console.WriteLine("Nhap thong tin cho nhom thu {0}:", i + 1);
                group.Input();
                groupList.Add(group);
                inforProjectList.Add(group.project.Display);
            }
            foreach (showInfor show in inforProjectList)
            {
                show();
            }
        }
    }
}


#Project.cs


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

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("Nhom du an:");
            int choose = 0;
            showMenu();
            do
            {
                choose = int.Parse(Console.ReadLine());
                switch (choose)
                {
                    case 1:
                        group = "Development & Design Website";
                        break;
                    case 2:
                        group = "Website Developer";
                        break;
                    case 3:
                        group = "Application Developer";
                        break;
                    default:
                        Console.WriteLine("Nhap sai, vui long nhap lai!!");
                        break;
                }
            } while (choose != 1 && choose != 2 && choose != 3);
        }
        public void showMenu()
        {
            Console.WriteLine("Chon 1 trong 3 group:");
            Console.WriteLine("1.Development & Design Website");
            Console.WriteLine("2.Website Developer");
            Console.WriteLine("3.Application Developer");
        }
        public void Display()
        {
            Console.WriteLine("Ten de tai: {0}, Nhom du an: {1}", name, group);
        }
    }
}



Trần Văn Lâm [T2008A]
Trần Văn Lâm

2021-06-04 08:28:35

:3


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

2021-06-04 08:20:20

ly thuyet


hainguyen [T2008A]
hainguyen

2021-06-04 08:19:33



điểm thi lý tuyết





Đỗ Mạc Nam [T2008A]
Đỗ Mạc Nam

2021-06-04 08:19:08

Thầy đẹp trai


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

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