7 kyu

Surface Area and Volume of a Trapezoidal Prism

179pshp

Description:

Write a function that returns the total surface area and volume of a trapezioidal prism as an array [area, volume], rounded to the nearest integer. A trapezoidal prism is shape that has trapezium (trapezoid) cross sections in one direction and rectangular cross sections in the other directions.

a = top width of trapezium cross section, b = base width of trapezium cross section, h = height of cross section (distance from a to b), l = length of prism.

Diagram of a trapeziodal prism:

https://d138zd1ktt9iqe.cloudfront.net/media/seo_landing_files/trapezoidal-prism-1622086836.png

Trapezium cross section:

        a
    __________      
   /          \    |
  /            \   |h
 /______________\  |
        b

The tapazium cross section has one line of symmetry:

    ____|____
   /    |    \
  /     |     \
 /______|______\
        |
Fundamentals
Algorithms
Mathematics
Algebra
Geometry

More By Author:

Check out these other kata created by pshp

Stats:

CreatedOct 14, 2016
PublishedOct 17, 2016
Warriors Trained472
Total Skips12
Total Code Submissions1170
Total Times Completed179
JavaScript Completions179
Total Stars7
% of votes with a positive feedback rating91% of 68
Total "Very Satisfied" Votes57
Total "Somewhat Satisfied" Votes10
Total "Not Satisfied" Votes1
Total Rank Assessments9
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • pshp Avatar
  • Valefar Avatar
Ad