Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Comments
* Fix the syntax errors.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Declaring a string
* Assign streetAddress with the string 1313 Mockingbird Lane.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples : n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

mehr als 10 Jahre vor

Gelöst


Filter AC, pass DC
Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

mehr als 10 Jahre vor

Gelöst


Arithmetic array operations
* Add x to each element of array temperatureReadings.

mehr als 10 Jahre vor

Gelöst


Declaring a character
* Assign middleInitial with the character T.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

mehr als 10 Jahre vor

Gelöst


Construct an array
* Construct an row array named observedValues with elements sensorReading1, sensorReading2, and sensorReading3.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Back to basics 15 - classes
Covering some basic topics I haven't seen elsewhere on Cody. Return the class of the input variable.

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

mehr als 10 Jahre vor

Gelöst


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

mehr als 10 Jahre vor

Gelöst


Logic variables
* Assign isAvailable with true.

mehr als 10 Jahre vor

Gelöst


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

mehr als 10 Jahre vor

Mehr laden