โ Back to Classes
Question 432
Triangle Area Class
Triangle Area Class
Create a classTrianglewhose constructor stores a base length and a height, and anArea()method that returns half of base times height. Do not write aMainmethod. For a base of 4 and height of 3 the program prints: 6
Expected Output:
6
Topics:
Classes
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.