Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Challenge 2: Implement the Complete Student Class

Sumit Rawal answered on May 17, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Challenge 2: Calculate the Student's Performance
  • Challenge 3: Implement a Calculator Class
  • Solution Review: Implement the Complete Student Class
  • Challenge 1: Implement the Derived Class

  • Challenge 2: Implement the Complete Student Class

    0

    Problem statement

    Implement the complete Student class by completing the tasks below

    Task

    Implement the following properties as private:

    name

    rollNumber

    Include the following methods to get and set the private properties above:

    getName()

    setName()

    getRollNumber()

    setRollNumber()

    Implement this class according to the rules of encapsulation.

    Input

    Checking all the properties and methods

    Output

    Expecting perfectly defined fields and getter/setters

    Note: Do not use initializers to initialize the properties. Use the set methods to do so. If the setter is not defined properly, the corresponding getter will also generate an error even if the getter is defined properly.

    Coding exercise

    First, take a close look, and then design a step-by-step algorithm before trying the implementation. This problem is designed for your practice, so initially try to solve it on your own. If you get stuck, you can always refer to the solution provided in the next lesson. 

    Popularity 1/10 Helpfulness 1/10 Language python
    Source: Grepper
    Tags: class python
    Link to this answer
    Share Copy Link
    Contributed on May 17 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.