project: Coding aptitude assessment challenge: Task 4

Tags skill/problem_solving
Hard Prerequisites
IMPORTANT: Please review these prerequisites, they include important information that will help you with this content.
  • CODING_APTITUDE_ASSESSMENT: Introduction to coding challenges
  • CODING_APTITUDE_ASSESSMENT: IMPORTANT!! Naming your files and functions
  • Write a function that takes in three integer numbers. These numbers represent the lengths of the sides of a triangle. The function should calculate the area of a triangle, and then round the area down to the nearest integer value. The final answer should be returned.

    If the answer is a floating point number then round down. For example if the area if 6.99999 then you should return 6.

    This article will explain how to calculate the area of a triangle

    Example usage:

    • task4(3, 4, 5) should return 6
    • task4(7, 8, 10) should return 27

    Check your understanding!

    • how would you write a function that calculates the area of a square?
    • how would you write a function that calculates the area of a rectangle?

    RAW CONTENT URL