Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Nodes
- {
- class Grade
- {
- private Class[] classes { get; }
- public Grade(Class[] classes)
- {
- this.classes = classes;
- }
- public int numberOfSubjects(int ID)
- {
- foreach (Class c in classes)
- {
- Node<Student> pos = c.getStudents();
- while (pos != null)
- {
- if (pos.getValue().ID == ID)
- {
- return LinkedListUtils.listLength(pos.getValue().getSubjects());
- }
- }
- }
- return -1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement