A résolu


Plus x: A first program
_Solve this problem in Mathwork's online Cody system._ Write a statement that assigns y with 5 plus x. Ex: If input x = 2,...

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Circle area using pi
Write a statement that assigns circleArea with the circle's area given circleRadius. Use the built-in mathematical constant pi. ...

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Declaring a character
* Assign middleInitial with the character T.

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Logic variables
* Assign isAvailable with true.

plus de 11 ans il y a

A résolu


Comments
* Fix the syntax errors.

plus de 11 ans il y a

A résolu


Multi-line comments
* Fix the syntax errors.

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Indexing an array element
* Assign currentStudent with the second element of array testScores.

plus de 11 ans il y a

A résolu


Indexing the array: Moving values
* Write three statements to shift the array contents 1 position to the left. * The rightmost element should be assigned -1.

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

Charger plus