Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...
4개월 전
문제를 풀었습니다
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displayed ...
4개월 전
문제를 풀었습니다
Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas:
1 kilogram = 2.2 pounds
1 inch = 2...
4개월 전
문제를 풀었습니다
Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.
4개월 전
문제를 풀었습니다
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
4개월 전
문제를 풀었습니다
What's size of TV?
Many people buy TV. Usually they ask about diagonal. But also important are width and height. Let's assume that all TV have rati...
5개월 전
문제를 풀었습니다
Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not.
Example:
1:7 -> 0
[7 5 2] -> 1
5개월 전
문제를 풀었습니다
Sum of diagonal of a square matrix
If
x = [1 2 4; 3 4 5; 5 6 7]
then y should be the sum of the diagonals of the matrix
y = 1 + 4 + 7 = 12
5개월 전
문제를 풀었습니다
An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:*
Many important observations in math and science can be described by short, but powerful, equations...