Community Profile

# Caleb Sarver

81 total contributions since 2016

View details...

Contributions in
View by

Solved

03 - Matrix Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3c.png>> A 10x10 matrix where the numbers from 1 to 100 ...

plus de 3 ans ago

Solved

only input
Return the output without writing any code into the function.

plus de 3 ans ago

Solved

Try 1.5.4: Celsius to Fahrenheit
Write a program to convert an input given in Celsius to Fahrenheit. Examples: Input celsiusValue = 100 Output fahrValu...

plus de 3 ans ago

Solved

Back to basics 9 - Indexed References
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

plus de 3 ans ago

Solved

Tree Height
Assign treeHeight with the tree height given the shadow length and angle of elevation. Simple geometry can compute the heigh...

plus de 3 ans ago

Solved

Who is the smartest MATLAB programmer?
Who is the smartest MATLAB programmer? Examples: Input x = 'Is it Obama?' Output = 'Me!' Input x = 'Who ?' Ou...

plus de 3 ans ago

Solved

Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

plus de 3 ans ago

Solved

Compute total cost
A soda costs 2 dollars. A taco costs 3 dollars. Write a statement that assigns totalCost with the total meal cost given the numb...

plus de 3 ans ago

Solved

Assigning a sum
* Write a statement that assigns numCoins with numNickels + numDimes.

plus de 3 ans ago

Solved

Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

plus de 3 ans ago

Solved

Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

plus de 3 ans ago

Solved

Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

plus de 3 ans ago

Solved

Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

plus de 3 ans ago

Solved

Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

plus de 3 ans ago

Solved

give nth decimal place of pi
max 15th place after the decimal point is ok for now

plus de 3 ans ago

Solved

Find remainder when x is divided by 3
Find remainder when x is divided by 3

plus de 3 ans ago

Solved

y equals x divided by 2
function y = x/2

plus de 3 ans ago

Solved

Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

plus de 3 ans ago

Solved

Write an expression
Assigns finalResult with firstSample plus secondSample, squared, then divided by 3. Ex: If firstSample is 18 and secondSample is...

plus de 3 ans ago

Solved

Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

plus de 3 ans ago

Solved

Spherical Volume
Calculate the volume of a sphere.

plus de 3 ans ago

Solved

How long does it take to run a bath?
Given the *volume flow rate* (volume/time) of a faucet and the *volume* of a bath tub, find the amount of time it takes to fill ...

plus de 3 ans ago

Solved

Calculate volume of box
Calculate the volume of box,hiven its sides

plus de 3 ans ago

Solved

Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.

plus de 3 ans ago

Solved

grazing cows
Here is a fun problem I encountered in high school. Two cows are grazing in an enclosed square-shaped field of side length s ...

plus de 3 ans ago

Solved

Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

plus de 3 ans ago

Solved

find the Area of a rectangle
length is x width is y what is the area of the rectangle?

plus de 3 ans ago

Solved

Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

plus de 3 ans ago

Solved

Find the area of a rectangle if length of the diagonal is given.
if length of a diagnonal in rectangle is 5. Its area is 12.

plus de 3 ans ago

Solved

Area of rhombus
Calculate the rhombus area

plus de 3 ans ago