Home > Net >  Console small programs, bosses are interested probably [face] qq: 89. GIF [/face]
Console small programs, bosses are interested probably [face] qq: 89. GIF [/face]

Time:10-07

using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. The Text;
Using System. The Threading. The Tasks;

The namespace ConsoleApp1
{
Class Program
{
The static void Main (string [] args)
{
# region fake data
List StudentList=new List () {
New Student () {id=1, name="Student1," lastName="1" lastName},
New Student () {id=2, name="Student2", courseid=2, courseMark=100},
New Student () {id=3, name="Student3," lastName="4" lastName},
New Student () {id=4, name="Student4", courseid=4},
New Student () {id=5, name="Student5", courseid=3, courseMark=90},
};
List CourseList=new List ()
{
New Course () {id=1, name="course1"},
New Course () {id=2, name="course2"},
New Course () {id=3, name="course3"},
New Course () {id=4, name="course4"},
New Course () {id=5, name="course5"},
};
List HobbyList=new List ()
{
New Hobby () {id=1, name="Hobby1"},
New Hobby () {id=2, name="Hobby2"},
New Hobby () {id=3, name="Hobby3"},
New Hobby () {id=4, name="Hobby4"},
New Hobby () {id=5, name="Hobby5"},
};
List{
New Student_Hobby () {studentid=1, hoddyid=1},
New Student_Hobby () {studentid=1, hoddyid=2},
New Student_Hobby () {studentid=2, hoddyid=1},
New Student_Hobby () {studentid=4, hoddyid=1},
New Student_Hobby () {studentid=4, hoddyid=4},
New Student_Hobby () {studentid=4, hoddyid=2},
New Student_Hobby () {studentid=5, hoddyid=1},
};
# endregion
The class Student
{
Public int id {get; The set; }
Public string name {get; The set; }
Public string lastName {get; The set; }
Public int? Courseid {get; The set; }
Public int? CourseMark {get; The set; }
}
The class Course
{
Public int id {get; The set; }
Public string name {get; The set; }
Public string remark {get; The set; }
}
The class Hobby
{
Public int id {get; The set; }
Public string name {get; The set; }
Public string remark {get; The set; }
}
The class Student_Hobby
{
Public int studentid {get; The set; }
Public int hoddyid {get; The set; }
}

}


/* functional requirements and display template
Display Student name By hobby and count//according to the hobby according to Student's name
Display Student Course mark and sum total//show students Course score and total
Display course without student//show no student course
Display the student the contains hobby that wining 1//show the students' interests more than 1
Note: student lastname display '-' if empty, course name='-', mark=0//note: student name show '- if is empty, course name="-", mark=0

Enter Hobby: Hobby1
ID Student LastName Course Mark
1 Student1 lastname 1-0
2 Student2 course2-100


Student course Mark
ID Student LastName Course Mark
1 Student2 course2-100
2 Student4 - course3 0
3 Student5 course3-90
-- -- -- -- -- --
The Sum of 190

Course Total Student
Course1 0
Course2 1
Student Mark
Student2 100
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Course3 1
Student Mark
Student5 90
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Course4 1
Student Mark
Student4 -
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Course5 0


Student Hobby List
ID Student LastName HobbyCount Hobby
1 2 1 Student1 lastname Hobby1, Hobby2
Student4 2-3 Hobby1 Hobby2, Hobby4
*/

CodePudding user response:

Tell your problem,, didn't understand

CodePudding user response:

Is I didn't say clear... asked to complete the four function and the function display templates in the annotations on the bottom of the Console to use the Console application is completed,

CodePudding user response:

You need to do,

CodePudding user response:

The console?? Template??????

Well, we didn't kung fu

Just to tell you how to play, to baidu "T4 text template engine", then, not then,

Written by the T4, call the engine, the text, and then read one line, one line of output, the ans not that time give you the typesetting, let T4 engine to row

CodePudding user response:

Summer vacation homework? [word] enough

CodePudding user response:

Come on, let students play with you
  •  Tags:  
  • C#
  • Related