Gelöst


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

mehr als 8 Jahre vor

Gelöst


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

mehr als 8 Jahre vor

Gelöst


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

mehr als 8 Jahre vor

Gelöst


Do you like your boss?
Do you like your boss? Answer can be any string! For example: Boss = 'Do you like your boss?'; Output = 'yes' or ...

mehr als 8 Jahre vor

Gelöst


07 - Common functions and indexing 6
Create a variable _m_ as a magic square with the size 6 x 6 Magic squares are defined as square matrices, where the sum of a...

mehr als 8 Jahre vor

Gelöst


04 - Scalar Equations 1
Define the variable a: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x: <<http://samle.dk/STTBD...

mehr als 8 Jahre vor

Gelöst


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

mehr als 8 Jahre vor

Gelöst


Rounding
Round 10.67 and make 'y' equal to that number.

mehr als 8 Jahre vor

Gelöst


03 - Matrix Variables 5
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

mehr als 8 Jahre vor

Gelöst


03 - Matrix Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3b.png>> A 9x9 matrix of zeros, but with the following v...

mehr als 8 Jahre vor

Gelöst


02 - Vector Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2d.png>> (Logarithmically spaced numbers between 1 and 1...

mehr als 8 Jahre vor

Gelöst


Function definition: BMI calculator
Define a function CalculateBMI with inputs massKg and heightCm. The function returns bodyMassIndex. The function should be able ...

mehr als 8 Jahre vor

Gelöst


02 - Vector Variables 5
_eVec_ = _Hello_ ( _eVec_ is a string, which is a vector of characters )

mehr als 8 Jahre vor

Gelöst


02 - Vector Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2c.png>> (all the numbers from 5 to -5 in increments of ...

mehr als 8 Jahre vor

Gelöst


02 - Vector Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2a.png>>

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

Gelöst


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

mehr als 8 Jahre vor

Gelöst


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

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

Gelöst


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

mehr als 8 Jahre vor

Gelöst


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

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

Gelöst


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

mehr als 8 Jahre vor

Gelöst


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

mehr als 8 Jahre vor

Gelöst


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

mehr als 8 Jahre vor

Mehr laden