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

Solution Review: Pass or Fail

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

Contents


More Related Answers

  • pass fail criteria
  • Challenge: Pass or Fail

  • Solution Review: Pass or Fail

    0

    Task

    In this challenge, you were provided the final percentage a student had at the end of the semester. You had to write a program which would determine if the student passed or failed. If the percentage was greater than or equal to 60, the student passed, and if it was less than 60, the student failed.

    Solution

    Let’s go over the solution step-by-step.

    The first thing you had to figure out is that this problem has conditions and would require an if-else expression.

    Next, you had to figure out what the conditions were. The first condition is that the student gets a percentage which is greater than or equal to 60. In which case you would print pass.

    if (percentage >= 60)

    print("pass")

    Finally, the last step required you to figure out the default condition, which was that the student gets a percentage which is less than 60. In this case, you would print fail.

    else

    print("fail")

    You can find the complete solution below:

    You were required to write the code from line 3 to line 6. 

    Popularity 1/10 Helpfulness 1/10 Language scala
    Source: Grepper
    Tags: scala solution
    Link to this answer
    Share Copy Link
    Contributed on May 23 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.