Completed the assignment no 1#1
Conversation
There was a problem hiding this comment.
Don't include the generated PDF files
There was a problem hiding this comment.
Don't include the generated PDF files
There was a problem hiding this comment.
Don't include the generated PDF files
There was a problem hiding this comment.
Don't include the generated PDF files
There was a problem hiding this comment.
Don't include the generated CSV files
There was a problem hiding this comment.
Don't include the generated CSV files
| # then defined conditions for each option and called the function of LMS by passing its instance in the function. | ||
| case option | ||
| when "1" | ||
| puts "Enter your id" |
There was a problem hiding this comment.
Also should make small function against each option case to increase the readability
Refcator repeated code by making its function.
def fetch_student_input
puts "Enter student ID:"
gets.chomp.to_i
end
| subject_name=line['subject_name'] | ||
| score=line['score'].to_i | ||
| if @students[student_id] | ||
| subject=Subject.new(student_id,subject_name,score) |
| end | ||
| #this function checks wheter that astudent exists or not and return its instance to get related data for user. | ||
| def find_student(id) | ||
| @students[id]? @students[id] : nil |
There was a problem hiding this comment.
The method should raise an error message if the ID isn't found, so that whenever this method is called, it will raise an error indicating that the specific student was not found."
| score=line['score'].to_i | ||
| if @students[student_id] | ||
| subject=Subject.new(student_id,subject_name,score) | ||
| @students[student_id].add_subject(subject) |
There was a problem hiding this comment.
Need to raise an error or implement functionality if the student ID is not present in the @Students hash.
Description
This pull request introduces the main lms.rb file, which includes the core functionality for the LMS (Learning Management System). Additionally, it includes: