[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
Tags:
Phản hồi từ học viên
5
(Dựa trên đánh giá ngày hôm nay)
![bui duy khanh [T2008A]](https://www.gravatar.com/avatar/50b4bb73ad99c982b2c18af8cf07e2a4.jpg?s=80&d=mm&r=g)
bui duy khanh
2021-06-04 11:04:38
kết quả bài thi thực hành.
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;
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();
}
}
}
}
![bui duy khanh [T2008A]](https://www.gravatar.com/avatar/50b4bb73ad99c982b2c18af8cf07e2a4.jpg?s=80&d=mm&r=g)
bui duy khanh
2021-06-04 10:59:00
kết quả bài thi ý thuyết.
![Nguyễn Hữu Hiếu [T2008A]](https://www.gravatar.com/avatar/ca2884508b617fee77f000c7d99c219d.jpg?s=80&d=mm&r=g)
Nguyễn Hữu Hiếu
2021-06-04 10:41:33
123
![Nguyễn Hữu Hiếu [T2008A]](https://www.gravatar.com/avatar/ca2884508b617fee77f000c7d99c219d.jpg?s=80&d=mm&r=g)
Nguyễn Hữu Hiếu
2021-06-04 10:41:11
Kết quả lý thuyết
![Nguyễn đình quân [T2008A]](https://www.gravatar.com/avatar/46aca6afcfe99fdb28357afb847d8a0c.jpg?s=80&d=mm&r=g)
Nguyễn đình quân
2021-06-04 10:18:56
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;
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++)
![Đặng Trần Nhật Minh [T2008A]](https://www.gravatar.com/avatar/ee8dc5a777ad26f3a962e86c233437cf.jpg?s=80&d=mm&r=g)
Đặng Trần Nhật Minh
2021-06-04 10:14:05
#Screenshot (36).png
https://res.cloudinary.com/wegoup/image/upload/v1622801640/k8ni1qakfvrslnvqwlah.png
![hainguyen [T2008A]](https://www.gravatar.com/avatar/32855ce6db55d60134d830aee06b41e5.jpg?s=80&d=mm&r=g)
hainguyen
2021-06-04 09:44:30
điểm lý thuyết UP Lại:
![Trần Văn Lâm [T2008A]](https://www.gravatar.com/avatar/cfc15c8cb7781ad669b013e01f9f1a6b.jpg?s=80&d=mm&r=g)
Trần Văn Lâm
2021-06-04 09:41:45
#Group.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestCsharp
{
class Group
{
static Project pr = new Project();
public string name { get; set; }
public string center { get; set; }
public Project project { get; set; }
public Group()
{
}
public Group(string name, string center, Project project)
{
this.name = name;
this.center = center;
this.project = project;
}
public void Input()
{
Console.WriteLine("Nhap ten de tai:");
name = Console.ReadLine();
Console.WriteLine("Nhap ten trung tam:");
center = Console.ReadLine();
Console.WriteLine("Nhap project;");
String project = Console.ReadLine();
pr.Input();
}
public void Display()
{
Console.WriteLine("Ten de tai : {0}, Ten trung tam {1}, Project : {2}", name, center, project);
pr.Display();
}
}
}
#Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestCsharp
{
class Program
{
public delegate void ShowInfor();
static void Main(string[] args)
{
List<ShowInfor> showInforList = new List<ShowInfor>();
List<Group> groupList = new List<Group>();
Console.WriteLine("Nhap ngau nhien N nhom:");
Random r = new Random();
int N = r.Next(2, 10);
for (int i = 0; i < N; i++)
{
Project pr = new Project();
Group gr = new Group();
gr.Input();
groupList.Add(gr);
showInforList.Add(gr.Display);
}
foreach (ShowInfor show in showInforList)
{
show();
}
}
}
}
#Project.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestCsharp
{
class Project
{
public string name { get; set; }
public string Group;
public string group
{
get
{
return group;
}
set
{
if (value.Equals("Development & Design Website") || value.Equals("Website Developer") || value.Equals("Application Developer"))
{
this.Group = value;
}
else
{
Console.WriteLine("Nhan 3 gia tri Development & Design Website, Website Developer, Application Developer");
}
}
}
public Project()
{
}
public void Input()
{
Console.WriteLine("Nhap ten de tai :");
name = Console.ReadLine();
Console.WriteLine("Nhap nhom:");
group = Console.ReadLine();
}
public void Display()
{
Console.WriteLine("Ten de tai : {0}, Nhom : {1}", name, group);
}
}
}
![Nguyễn Anh Vũ [T2008A]](https://www.gravatar.com/avatar/8863d24ed74b396082becbc4db8331fd.jpg?s=80&d=mm&r=g)
Nguyễn Anh Vũ
2021-06-04 09:41:37
Thi lý thuyết 55%
![Đỗ Minh Quân [T2008A]](https://www.gravatar.com/avatar/fa40264d7c4b4209c87a9e9451d2b9f0.jpg?s=80&d=mm&r=g)
Đỗ Minh Quân
2021-06-04 09:36:21
https://res.cloudinary.com/wegoup/image/upload/v1622799355/hictuwoszuftzty2e3xy.png