Student Class: representing a student, its properties and functionalities
1. Properties of each student are hidden (private) from client code:
o name (string)
o student_id (string)
o year_of_birth (int)
o isActive (boolean – true/false)
2. Constructors and Functions:
o Default constructor – set the year of birth to 1995 and the status to active
o Constructor1 – for assigning name and student id
o Constructor2 – for assigning name, student id, and year of birth
o Constructor3 – for assigning name, student id, year of birth, and status
o Functions – for setting values of each property (4 functions)
o Functions – for getting value of each property (4 functions)
o public override string ToString() {…} – the function for printing value of all properties
Course Class: representing a course, its properties and functionalities
1. Properties of each student are hidden (private) from client code:
o course_name (string)
o course_id (string)
o lecturer (string)
o max_students (int - maximum number of enrolled students)
o no_students (int - current number of enrolled students)
2. Constructors and Functions:
o Default constructor – set maximum #student of enrolled students to 30
o Constructor1 – for assigning course name and course id
o Constructor2 – for assigning course name, course id, and name of lecturer
o Constructor3 – for assigning course name, course id, name of lecturer, and max #students
o Functions – for setting values of each property (5 functions)
o Functions – for getting value of each property (5 functions)
o public override string ToString() {…} – the function for printing value of all properties
หน้าที่ 2/3
Create a program to test your classes (Student and Course) –in the Main function
• Creates objects of 7 students, initializes the first student with no name and no student id. The rest of
students has to have names in the pattern s2, s3, s4, … respectively
• Initializes the 2
nd to 7th
students with student id of 56002, 56003, … 56007
• Initializes the 3rd
and 4th
students to have year of birth in 1994 and 1996 respectively
• Show status of all students on the screen using the statement Console.WriteLine( [student object name] );
• Modify name of the 5th
student as your name
• Modify year of birth of the 6th
student to 1997
• Modify student id of the 7th
student to 55084, status of the student to NOT active
• Show status of the modified students on the screen using the statement Console.WriteLine( [student object name] );
• Create objects of 3 courses
o cpe102: (Programming Language for CPE, 261102)
o isne103: (Programming Language for ISNE, 269103, Dome)
o cpe453: (Digital Image Processing, 261453, Dr.Ken, max #student of 60)
• Show status of all courses on the screen using the statement Console.WriteLine( [course object name] );
• Modify the lecturer name of the Digital Image Processing course to “Dome” and the max. #student to
receive to 25
• Show status of all courses on the screen using the statement Console.WriteLine( [course object name] );
Example of Program Execution
นักเรียน: ตัวแทนนักเรียน คุณสมบัติ และฟังก์ชันการทำงาน 1. คุณสมบัติของนักศึกษาถูกซ่อนอยู่ (ส่วนตัว) จากรหัสไคลเอนต์: ชื่อ o (สตริง) o student_id (สายอักขระ) o year_of_birth (int) o isActive (บูลีน – จริง/เท็จ) 2. ตัวสร้างและฟังก์ชัน: o เริ่มต้นตัวสร้าง – ตั้งปีเกิดการ 1995 และสถานะการใช้งาน o Constructor1 – สำหรับการกำหนดรหัสชื่อและนักเรียน o Constructor2 – สำหรับการกำหนดชื่อ รหัสนักศึกษา และปีเกิด o Constructor3 – สำหรับการกำหนดชื่อ รหัสนักศึกษา ปีเกิด และสถานะ o ฟังก์ชันการตั้งค่าของคุณสมบัติแต่ละรายการ (หน้าที่ 4) o ฟังก์ชันการรับค่าของคุณสมบัติแต่ละ (หน้าที่ 4) สตริงการแทนสาธารณะ o ToString() {...} -ฟังก์ชันการพิมพ์ค่าของคุณสมบัติทั้งหมด ระดับหลักสูตร: แสดงถึงหลักสูตร คุณสมบัติ และฟังก์ชันการทำงาน 1. คุณสมบัติของนักศึกษาถูกซ่อนอยู่ (ส่วนตัว) จากรหัสไคลเอนต์: o course_name (สายอักขระ) o course_id (สายอักขระ) o อาจารย์ (สายอักขระ) o max_students (int - จำนวนนักเรียน) o no_students (int - จำนวนนักเรียนปัจจุบัน) 2. ตัวสร้างและฟังก์ชัน: o เริ่มต้นตัวสร้าง – ตั้งค่า #student สูงสุดของนักเรียน 30 o Constructor1 – สำหรับการกำหนดชื่อวิชาและรหัสหลักสูตร o Constructor2 – สำหรับการกำหนดชื่อหลักสูตร รหัสหลักสูตร และชื่อของอาจารย์ o Constructor3 – สำหรับการกำหนดชื่อหลักสูตร รหัสหลักสูตร ชื่ออาจารย์ และสูงสุด #students o ฟังก์ชันการตั้งค่าของคุณสมบัติแต่ละรายการ (หน้าที่ 5) o ฟังก์ชันการรับค่าของคุณสมบัติแต่ละ (หน้าที่ 5) สตริงการแทนสาธารณะ o ToString() {...} -ฟังก์ชันการพิมพ์ค่าของคุณสมบัติทั้งหมด หน้าที่ 2/3สร้างโปรแกรมเพื่อทดสอบห้องเรียน (นักเรียนและหลักสูตร) – ในการทำงานหลัก•สร้างวัตถุของ 7 นักเรียน นักศึกษาครั้งแรกไม่มีชื่อและไม่มีรหัสนักศึกษาเริ่มต้น ส่วนเหลือของ นักเรียนได้มีชื่อในรูปแบบ s2, s3, s4,...ตามลำดับ •เริ่มต้น 2nd ไป 7 นักศึกษาที่ มีรหัสนักศึกษาของ 56002, 56003, ... 56007 •เริ่มต้นที่ 3 และ 4 นักเรียนจะมีปีเกิดในปี 1994 และ 1996 ตามลำดับ •แสดงสถานะของนักเรียนทั้งหมดบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([นักเรียนชื่อวัตถุ]); •แก้ไขชื่อของในวันที่ 5 นักศึกษาเป็นชื่อของคุณ •แก้ไขปีเกิด 6 ตัว นักศึกษาที่ปี 1997 •ปรับเปลี่ยนรหัสนักศึกษาของ 7 เรียน 55084 สถานะของนักศึกษาที่ไม่ใช้งาน •แสดงสถานะของนักเรียนปรับเปลี่ยนบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([นักเรียนชื่อวัตถุ]); •สร้างวัตถุหลักสูตร 3 o cpe102: (เขียนภาษา CPE, 261102) o isne103: (เขียนภาษา ISNE, 269103 โดม) o cpe453: (ดิจิทัลภาพประมวลผล 261453, Dr.Ken สูงสุด #student 60 ปี) •แสดงสถานะของหลักสูตรทั้งหมดบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([หลักสูตรวัตถุชื่อ]); •แก้ไขชื่ออาจารย์ประจำหลักสูตรประมวลผลภาพดิจิทัล "โดม" และสูงสุด #student ไป ได้รับ 25 •แสดงสถานะของหลักสูตรทั้งหมดบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([หลักสูตรวัตถุชื่อ]); ตัวอย่างของโปรแกรม
การแปล กรุณารอสักครู่..

คลาสนักศึกษาที่เป็นตัวแทนของนักเรียนคุณสมบัติและฟังก์ชัน
1 คุณสมบัติของนักเรียนแต่ละคนจะถูกซ่อนไว้ (ส่วนตัว) จากรหัสลูกค้า:
o ชื่อ (สตริง)
o student_id (สตริง)
o year_of_birth (int)
o IsActive (บูลีน - จริง / เท็จ)
2 ก่อสร้างและฟังก์ชั่น:
o สร้างเริ่มต้น - ตั้งปีเกิด 1995 และสถานะที่ใช้งาน
o constructor1 - สำหรับการกำหนดชื่อและรหัสนักศึกษา
o constructor2 - สำหรับการกำหนดชื่อ id นักเรียนและปีเกิด
o Constructor3 - สำหรับการกำหนดชื่อ id นักเรียนปีเกิดและสถานะของ
ฟังก์ชั่น o - สำหรับการตั้งค่าของแต่ละสถานที่ให้บริการ (4 ฟังก์ชั่น)
o ฟังก์ชั่น - การรับค่าของแต่ละสถานที่ให้บริการ (4 ฟังก์ชั่น)
ประชาชน o แทนที่สตริง ToString () {... } - ฟังก์ชั่นสำหรับการพิมพ์ ค่าของคุณสมบัติชั้นหลักสูตร: หลักสูตรที่เป็นตัวแทนของคุณสมบัติและฟังก์ชัน1 คุณสมบัติของนักเรียนแต่ละคนจะถูกซ่อนไว้ (ส่วนตัว) จากรหัสลูกค้า: o course_name (สตริง) o course_id (สตริง) วิทยากร o (สตริง) o max_students (int - จำนวนสูงสุดของนักเรียนที่ลงทะเบียนเรียน) o no_students (int - หมายเลขปัจจุบันของนักเรียนที่ลงทะเบียน) 2 ก่อสร้างและฟังก์ชั่น: o สร้างเริ่มต้น - การตั้งค่าสูงสุด #student ของนักเรียนลงทะเบียนเรียนถึง 30 o constructor1 - สำหรับการกำหนดชื่อหลักสูตรและ id แน่นอนo constructor2 - สำหรับการกำหนดชื่อแน่นอน id หลักสูตรและชื่อของอาจารย์o Constructor3 - สำหรับการกำหนดชื่อแน่นอน id แน่นอนชื่อของวิทยากรและสูงสุด #students ฟังก์ชั่น o - สำหรับการตั้งค่าของแต่ละสถานที่ให้บริการ (5 ฟังก์ชั่น) ฟังก์ชั่น o - สำหรับการรับค่าของแต่ละสถานที่ให้บริการ (5 ฟังก์ชั่น) ประชาชน o แทนที่สตริง ToString () {... } - ฟังก์ชั่น สำหรับค่าการพิมพ์ของคุณสมบัติทั้งหมดหน้าที่ 2/3 สร้างโปรแกรมเพื่อทดสอบชั้นเรียนของคุณ (นักเรียนและสนาม) -in หน้าที่หลัก•สร้างวัตถุของ 7 นักเรียนเริ่มต้นนักเรียนคนแรกที่ไม่มีชื่อและรหัสนักศึกษาไม่มี ส่วนที่เหลือของนักเรียนจะต้องมีชื่อในรูปแบบ S2, S3, S4, ... ตามลำดับ•เริ่มต้น 2 nd ให้ 7 นักเรียนที่มีรหัสนักศึกษา 56002, 56003, 56007 ... •เริ่มต้นที่ 3 และครั้งที่ 4 นักเรียนที่จะมีปีเกิดใน ปี 1994 และ 1996 ตามลำดับ•แสดงสถานะของนักเรียนทุกคนบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([ชื่อวัตถุนักเรียน]); •ปรับเปลี่ยนชื่อของ 5 นักเรียนเป็นชื่อของคุณ•ปรับเปลี่ยนปีเกิดของ 6 นักเรียน 1997 •ปรับเปลี่ยน id นักเรียนของ 7 นักเรียน 55084 สถานะของนักเรียนที่จะไม่ได้ใช้งานสถานะ•แสดงของนักเรียนการแก้ไขบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([ชื่อวัตถุนักเรียน]); •สร้างวัตถุ 3 หลักสูตรo cpe102: ( การเขียนโปรแกรมภาษาสำหรับ CPE, 261102) o isne103: (ภาษาเขียนโปรแกรมสำหรับ ISNE, 269103, โดม) o cpe453: (ประมวลผลภาพดิจิตอล, 261453, Dr.Ken, สูงสุด #student 60) •แสดงสถานะของหลักสูตรทั้งหมดบนหน้าจอโดยใช้ คำสั่ง Console.WriteLine ([แน่นอนชื่อวัตถุ]); •ปรับเปลี่ยนชื่ออาจารย์ของหลักสูตรการประมวลผลภาพดิจิตอล "โดม" และสูงสุด #student ที่จะได้รับถึง 25 •แสดงสถานะของหลักสูตรทั้งหมดบนหน้าจอโดยใช้คำสั่ง Console.WriteLine ([แน่นอนชื่อวัตถุ]); ตัวอย่างของการทำงานของโปรแกรม
การแปล กรุณารอสักครู่..
