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

Challenge 2: Calculate the Student's Performance

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

Contents


More Related Answers

  • Solution Review 2: Calculate the Student's Performance
  • Challenge 2: Implement the Complete Student Class

  • Challenge 2: Calculate the Student's Performance

    0

    Problem statement

    Implement a class - Student - that has four properties and two methods. All these attributes (properties and methods) should be public. This problem can be broken down into three tasks.

    Task 1

    Implement a constructor to initialize the values of four properties: name, phy, chem, and bio.

    Task 2

    Implement a method – totalObtained – in the Student class that calculates total marks of a student.

    Sample properties

    name = Mark

    phy = 80

    chem = 90

    bio = 40

    Sample method output

    obj1.Total()=210

    Task 3

    Using the totalObtained method, implement another method, percentage, in the Student class that calculates the percentage of students marks. Assume that the total marks of each subject are 100. The combined marks of three subjects are 300.

    The formula for calculating the percentage is given below.


    100

    TotalMarks

    MarksObtained

    ×100

    Sample input

    phy = 80

    chem = 90

    bio = 40

    Sample output

    70

    Coding exercise

    Design a step-by-step algorithm before jumping to 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 next lesson.

    Popularity 1/10 Helpfulness 1/10 Language python
    Source: Grepper
    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.