Solved


Function call in expression: Reduced pricing.
Write a single statement that assigns cartTotal with the discounted cost of items 1 and 2. Function DiscountedPrice will return ...

ongeveer 8 jaar ago

Solved


Indexing the array: Shift right with variable sized arrays
* Write a statement to shift the array contents 1 position to the left. * Assign the rightmost element with -1. Ex: [12, 85...

ongeveer 8 jaar ago

Solved


Extracting data: Heart rate (pulse)
The resting heart rate for an average adult is 60 - 100 beats per minute. Assign row array heartExtracted with all values in row...

ongeveer 8 jaar ago

Solved


Variable sized row arrays
* Reverse the contents of row array mileMarkers

ongeveer 8 jaar ago

Solved


Logic array: Identifying qualifying times
Create a logic array qualifyingIndex with true for any location where the runner is male with a running time less than 8.2. Row ...

ongeveer 8 jaar ago

Solved


Integer indexing array: Reverse subsets
Construct an indexing array copySubset so that the statement reversedOrder = origOrder(copySubset); results in a row array begin...

ongeveer 8 jaar ago

Solved


Multi-line comments
* Fix the syntax errors.

ongeveer 8 jaar ago

Solved


Function definition: Volume of a pyramid
Define a function CalculatePyramidVolume with inputs baseLength, baseWidth, and pyramidHeight. The function returns pyramidVolum...

ongeveer 8 jaar ago

Solved


Array resizing: Removing elements
* Remove elements 2, 4, and 6 from row array pendingTasks

ongeveer 8 jaar ago

Solved


Logical indexing: High scores
Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than 5...

ongeveer 8 jaar ago

Solved


Coordinate geometry
Assign pointsDistance with the distance between point (x1, y1) and point (x2, y2). The distance is calculated by: Distance =...

ongeveer 8 jaar ago

Solved


Population growth
Assign finalPopulation with the population size given an initial population, population growth rate, and number of years. The fi...

ongeveer 8 jaar ago

Solved


Integer indexing array: Weekend box office
The row array movieBoxOffice stores the amount of money a movie makes (in millions of $) for the 7 days of a week, starting with...

ongeveer 8 jaar ago

Solved


Fahrenheit to Celsius using multiple statements
°C = (°F - 32) x 5/9 * Write a statement that assigns fractionalMultiplier with 5/9. * Write a second statement that assign...

ongeveer 8 jaar ago

Solved


Relational operators and row arrays: Overweight baggage
Create a logical indexing array overweightBaggage with true in each location where the corresponding baggageWeight is greater th...

ongeveer 8 jaar ago

Solved


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

ongeveer 8 jaar ago

Solved


Return area of square
Side of square=input=a Area=output=b

ongeveer 8 jaar ago

Solved


Multiple element-wise operations: Percent change
Row arrays sales2013 and sales2014 reflect the quarterly sales (in millions) of a popular potato chip company. Write a statement...

ongeveer 8 jaar ago

Solved


Min of a Matrix
Return the minimum value in the given matrix.

ongeveer 8 jaar ago

Solved


Adding an element: Ticker tape
* Add stockPrice to the beginning of row array tickerTape

ongeveer 8 jaar ago

Solved


Constructing column arrays
* Construct a column array elevatorStops with values 2, 4, 5, 9, and 10

ongeveer 8 jaar ago

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...

ongeveer 8 jaar 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 ...

ongeveer 8 jaar ago

Solved


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

ongeveer 8 jaar ago

Solved


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

ongeveer 8 jaar ago

Solved


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

ongeveer 8 jaar ago

Solved


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

ongeveer 8 jaar 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...

ongeveer 8 jaar ago

Solved


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

ongeveer 8 jaar 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...

ongeveer 8 jaar ago

Load more