Solved

Column arrays: Transpose a row array
* Construct a row array countValues with elements 1 to endValue, using the colon operator. * Transpose countValues to result in...

más de 5 años ago

Solved

Linear-spaced points array
* Construct a row array plotPoints with 5 values that are spaced linearly from lowValue to highValue. Ex: If lowValue is 1 and ...

más de 5 años ago

Solved

Indexing the array: Moving values
Assume sampleReadings always contains three elements. * Shift the array contents one position to the left. * The rightmost ...

más de 5 años ago

Solved

Concatenating arrays
* Assign studentIDs with concatenated row arrays groupA and groupB

más de 5 años ago

Solved

Element-wise division
* Assign row array weightKilo with the corresponding weight in kilograms. Use the following conversion: kg = lb / 2.2

más de 5 años ago

Solved

Indexing an array element
* Assign currentStudent with the second element of array testScores. _Reminder: Array indexing starts with 1._

más de 5 años ago

Solved

Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

más de 5 años ago

Solved

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

más de 5 años ago

Solved

Relational operators: Guessing game
Row array userGuess contains a sequence of user guesses. Create a logical indexing array correctGuess with true in each location...

más de 5 años ago

Solved

Logical indexing: Player scores
Player 1 and player 2 take turns playing a game. Row array gameScores contains the scores of player 1, then player 2, then playe...

más de 5 años ago

Solved

Integer indexing array: Shift left
Write a *single* statement that shifts row array attendanceValues one position to the left. The rightmost element in attendanceV...

más de 5 años ago

Solved

Arithmetic array operations

más de 5 años ago

Solved

Character variable: Compass direction
* Assign compassDirection with sensorReading's value. Both are character variables.

más de 5 años ago

Solved

All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

más de 5 años ago

Solved

Function definition: Double down.
* Complete the DoubleDown function to return twice the initialValue.

más de 5 años ago

Solved

Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the hourly wage times 40 and times 50, because annualSalary = hour...

más de 5 años 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...

más de 5 años ago

Solved

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

más de 5 años ago

Solved

Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

más de 5 años ago

Solved

Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

más de 5 años ago

Solved

Logic variables
* Assign isAvailable with true.

más de 5 años ago

Solved

Computing wind chill
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...

más de 5 años ago

Solved

Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

más de 5 años ago

Solved

Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

más de 5 años ago

Solved

Double colon operator: Counting down
* Construct a row array countValues from startValue to endValue, elements decremented by -2 Ex: If startValue is 10 and end...

más de 5 años ago

Solved

Double colon operator: Counting up
* Construct a row array countValues from 1 to endValue, using the double colon operator. Ex: If endValue is 5, countValues s...

más de 5 años ago

Solved

Double colon operator: Increment by x
* Construct a row array countValues from 0 to 25, elements incremented by incrementValue. Ex: If incrementValue is 5, countVa...

más de 5 años ago

Solved

Indexing the last element: Print queue
* Delete the last element of row array printQueue.

más de 5 años ago

Solved