Gelöst


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

mehr als 7 Jahre vor

Gelöst


Insect population
An insect population doubles every generation. * Write a while loop that iterates numGeneration times. * Write a statment ...

mehr als 7 Jahre vor

Gelöst


Bridge toll
Complete the example to calculate finalToll. The base toll for a bridge is baseToll. If the vehicle's weight is over 5,000 pound...

mehr als 7 Jahre vor

Gelöst


Logical operators: Flipping bits
The xor operator will toggle the bit if the bit is xored with 1. Ex: 1 XOR 0 = 1, 1 XOR 1 = 0. The xor operator will retain th...

mehr als 7 Jahre vor

Gelöst


Logical operators and arrays: 3-input and truth table
Given 3 inputs (inputA, inputB, inputC), assign threeInputAnd with the truth table outcomes for a 3 variable logical-and operati...

mehr als 7 Jahre vor

Gelöst


Constructing strings
* Construct a string alphaString from 'a' to endLetter, using the double colon operator. Ex: If endLetter = 'e', then alphaSt...

mehr als 7 Jahre vor

Gelöst


Logical variables: Running late?
* Assign onTime with true if noTraffic is true and gasEmpty is false.

mehr als 7 Jahre vor

Gelöst


Relational operators and row arrays: Run times
* Construct a row array fastRunTimes containing all elements of runTimes equal to or less than 480 seconds. Ex: If runTimes =...

mehr als 7 Jahre vor

Gelöst


Nth root.
* Assign outValues with the nth root of the inValues, the root is specified by rootValue

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


Multi-line comments
* Fix the syntax errors.

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

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 7 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 7 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 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 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 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Gelöst


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

mehr als 7 Jahre vor

Mehr laden