Solved

Check bounds
Assign inRange with 1 if userWeight is greater than 100 and less than or equal to 200.

más de 4 años ago

Solved

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

más de 4 años ago

Solved

For loops: Odds sum
Write a for loop that assigns summedValue with the sum of all odd values from 1 to userNum. Assume userNume is always greater th...

más de 4 años ago

Solved

Dosage by weight
A machine administer's medication dosage based on weight. Write an if-elseif-else statement that assigns the appropriate dosageA...

más de 4 años ago

Solved

Assignment statements based on input value
Write an if-else statement that assigns finalValue with userValue + 5 if userValue is greater than 100. Otherwise assign finalVa...

más de 4 años ago

Solved

Preset rpm speeds
A centrifuge has four preset speeds. Write a switch statement that assigns rpmSetting with the appropriate rpm speed given prese...

más de 4 años ago

Solved

Armstrong Number
Determine whether the given input n-digit number is Armstrong Number or not. Return True if it is an Armstrong Number. An n-D...

más de 4 años ago

Solved

Multiple if statements
Write an if-statement that subtracts 5 from outputValue if amplitudeResponse is greater than 10. Write a second if-statement tha...

más de 4 años ago

Solved

For loops: Savings account
The for loop calculates the amount of money in a savings account after numberYears given an initial balace of savingsBalance and...

más de 4 años ago

Solved

While loop: Summation
Write a while loop that assigns summedValue with the sum of all values from 1 to userNum. Assume userNum is always greater than ...

más de 4 años ago

Solved

multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

más de 4 años ago

Solved

Evil Number
Check if a given natural number is evil or not. Read more at <https://oeis.org/A001969 OEIS>.

más de 4 años ago

Solved

Small aircraft weight limit
Write an if-else statement that evaluates to true if the sum of passengerWeight and cargoWeight is less than or equal maxWeight....

más de 4 años ago

Solved

Food safety
Assign safeTemperature with 1 if foodTemperature is less than 40 or greater than 165.

más de 4 años ago

Solved

Double summation
Write two nested for loops to calculate the following double summation: <<https://drive.google.com/uc?id=0B74PAULDIwwsWFhlNTV...

más de 4 años ago

Solved

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

más de 4 años ago

Solved

Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

más de 4 años ago

Solved

Find the 9's Complement
Find the 9's complement of the given number. An example of how this works is <http://electrical4u.com/9s-complement-and-10s-c...

más de 4 años ago

Solved

Comparing floating point values
* Assign matchFound with true if firstSample and secondSample are less than thresholdValue.

más de 4 años ago

Solved

Make a half wave rectifier
Produce a signal that outputs the given sine wave source when it is greater than zero and outputs zero when it is less than zero...

más de 4 años ago

Solved

Concatenating strings
* Write a statement that assigns fullName with firstName, a space, then lastName. Ex: If firstName is Alan and lastName is Tu...

más de 4 años ago

Solved

While loop with multiple conditions
Write a while loop that multiplies userValue by 2 while userValue is not 10 and while userValue is less than 25.

más de 4 años ago

Solved

While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...

más de 4 años ago

Solved

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

más de 4 años ago

Solved

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

más de 4 años ago

Solved

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

más de 4 años ago

Solved

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

más de 4 años ago

Solved

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

más de 4 años ago

Solved

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

más de 4 años 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...

más de 4 años ago

Load more