Git Product home page Git Product logo

uci-mod-3-assessment's Introduction

UCI Mod 3 Assessment

Introduction

In this assessment, you will be building a tool for helping teachers organize the courses they teach and the students in each. As this is designed from a teacher's perspective, a course has many students, and each student belongs to a specific course (though we know you may actually be taking multiple courses).

Your task is to build a set of collaborating Ruby objects, one to handle instances of Courses and one to handle Students. Write your solution in lib/oo_course_domain.rb following the instructions below.

Instructions

Student Class

Class Variables

@@all

Create an @@all class variable set to an array.

Initialization

#new

Initialize student instances with a string name. On initialization, the new student instance should be pushed into the @@all class variable.

Class Methods

.all

Write a .all class method that returns this variable. This variable will be used to contain all student instances that have been created.

Attribute Accessors

Students instances should have name, course and grade accessors. Since we have only assigned name when initializing, course and grade by default should return nil until they are assigned.

Instance Methods

#has_grade?

Write a has_grade? method that checks if the student's grade is assigned or is still the default nil. Return true if student has a grade, false if not.

Course

Class Variables

@@all

Create an @@all class variable set to an array.

Initialization

#new

Course instances should be initialized with a name argument. On initialization, the new course instance should be pushed into the @@all class variable.

Class Methods

.all

Write a .all class method that returns an array of all course instances that have been created.

Attribute Accessors

Course instances should have a name attribute accessor.

Instance Methods

#enroll_student

Write an #enroll_student instance method that takes in a student instance as an argument and associates that student with the course. It should do this by telling the student that it belongs to this particular course.

#enroll_student_by_name

Write an #enroll_student_by_name instance method that takes in a student name as a string, creates a new student instance, and associates that student with the course instance.

#add_grade

Write an #add_grade instance method that takes two arguments, a student instance and an Integer grade, and sets the student's grade.

#students

Write a #students instance method that returns a collection of student instances that are enrolled in a course.

#all_existing_grades

Write an #all_existing_grades instance method that returns a collection of all grades, leaving out any ungraded students.

#all_students_graded?

Write an #all_students_graded? instance method that does one of three things:

  • Returns true if all enrolled students have been assigned grades
  • Returns false if some enrolled students have yet to receive grades
  • Returns false if there are no students enrolled in the course
#average_grade

Write an #average_grade method that does one of two things:

  • if grading is finished, returns an average of all student grades. To calculate average, add all values together and divide by the number of values
  • if grading is not finished, returns a string 'Grading still in progress.'

uci-mod-3-assessment's People

Contributors

ahimmelstoss avatar aviflombaum avatar curiositypaths avatar deniznida avatar fislabstest avatar fs-lms-test-bot avatar gilmoursa avatar gj avatar jmburges avatar juangongora avatar kthffmn avatar loganhasson avatar maxwellbenton avatar realandrewcohn avatar sarogers avatar sophiedebenedetto avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.