1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
astra-53 [7]
3 years ago
5

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 finalValue with userValue + 3. Function Save Reset MATLAB DocumentationOpens in new tab function finalValue = AssignValue(userValue) % Assign finalValue with userValue + 5 if userValue is greater than 100 % Otherwise, assign finalValue with userValue + 3 finalValue = 0; end 1 2 3 4 5 6 7 Code to call your function Reset AssignValue(200) 1 Run Function
Engineering
1 answer:
GarryVolchara [31]3 years ago
5 0

Explanation:

We have created a function named "Value" which takes one argument "userValue" as input from the user.

Then we used if else statement to check if the user has entered a value greater than 100 then add 5 to the userValue and assign it to finalValue.

Otherwise add 3 to the userValue and assign it to finalValue and display the result of finalValue.

Then we tested the function with Value(200) and Value(85) and it returned the correct output.

Matlab Code:

function finalValue=Value(userValue)

userValue=input("Please Enter a value: ");

if(userValue>100)

   finalValue=userValue+5;

else

   finalValue=userValue+3;

disp(finalValue)

end

Output:

Test 1:

Value()

Please Enter a value: 200

ans =    205

Test 2:

Value()

Please Enter a value: 85

ans =    88

You might be interested in
Discuss how, as a safety professional, you would respond to the overlap in Occupational Safety and Health Administration (OSHA)
katrin2010 [14]

Answer:

Explanation:

As a security  professional, I will respond positively to the OSHA requirements overlap. OSHA guidelines are meant to provide general guidance to all members of various entities throughout the country, while local or state codes also ensure compliance with laws unique to their areas, taking into account workplace safety and security.

OSHA accepts the security codes of the state building To the degree that such codes comply with OSHA regulations, such as BOCA. All the codes and regulations for local, state-owned construction, electrical and life protection are under the same umbrella. Generally, all security protocols and specifications are in accordance with OSHA guidelines. Nonetheless, certain points will overlap, while localized codes will also be addressed to a particular community or state that may

3 0
3 years ago
Calculate the kinetic energy in kJ of an automobile (3,000 lb) travelling at 60 miles per hour.
AlladinOne [14]

Answer:

K = 18.26 KJ

Explanation:

See it in the pic.

4 0
3 years ago
Q#1: Provide an example of a software project that would be amenable to the following models. Be specific. a. Waterfall b. Proto
mote1985 [20]

Answer:

Waterfall model

Explanation:

The waterfall model is amenable to the projects. It focused on the data structure. The software architecture and detail about the procedure. It will interfere with the procedure. It interfaces with the characterization of the objects. The waterfall model is the first model that is introduced first. This model also called a linear sequential life cycle model.

The waterfall model is very easy to use. This is the earliest approach of the SDLC.

There are different phase of the waterfall:

  • Requirement analysis
  • System Design
  • Implementation
  • Testing
  • Deployment
  • Maintenance
4 0
3 years ago
A 12 m thick layer of Chicago clay is doubly drained. This means that a very previous layer compared to the clay exists on top o
iren2701 [21]

Answer:

At 3 =99.60

At 6 =66.66

At 12 =33.38

Please see attachment for the percent consolidation.

3 0
3 years ago
Consider a solid round elastic bar with constant shear modulus, G, and cross-sectional area, A. The bar is built-in at both ends
Ierofanga [76]

Answer:

\t(x)_{max} =\dfrac{p\times L}{2\times \pi}

Explanation:

Given that

Shear modulus= G

Sectional area = A

Torsional load,

t(x) = p sin( \frac{2\pi}{ L} x)

For the maximum value of internal torque

\dfrac{dt(x)}{dx}=0

Therefore

\dfrac{dt(x)}{dx} = p cos( \frac{2\pi}{ L} x)\times \dfrac{2\pi}{L}\\ p cos( \frac{2\pi}{ L} x)\times \dfrac{2\pi}{L}=0\\cos( \frac{2\pi}{ L} x)=0\\ \dfrac{2\pi}{ L} x=\dfrac{\pi}{2}\\\\x=\dfrac{L}{4}

Thus the maximum internal torque will be at x= 0.25 L

t(x)_{max} = \int_{0}^{0.25L}p sin( \frac{2\pi}{ L} x)dx\\t(x)_{max} =\left [p\times \dfrac{-cos( \frac{2\pi}{ L} x)}{\frac{2\pi}{ L}}  \right ]_0^{0.25L}\\t(x)_{max} =\dfrac{p\times L}{2\times \pi}

6 0
3 years ago
Other questions:
  • In a TDM communication example, 15 voice signals are badlimited to 5kHz and transmitted simultaneously using PAM. What is a prel
    14·1 answer
  • a steel rod of 30mm diameter is enclosed centerally in a hollow copper tube of external diameter 50mm and internal 40mm. the com
    9·1 answer
  • Dimensioning a drawing means​
    12·1 answer
  • A two-stage compression refrigeration system operates with refrigerant-134a between the pressure limits of 1.4 and 0.10 MPa. The
    6·1 answer
  • In a semiconductor manufacturing process, three wafers from a lot are tested. Each wafer is classified as pass or fail. Assume t
    15·1 answer
  • Durante el segundo trimestre de 2001, Tiger Woods fue el golfista que más dinero ganó en el PGATour. Sus ganancias sumaron un to
    9·1 answer
  • The temperature controller for a clothes dryer consists of a bimetallic switch mounted on an electrical heater attached to a wal
    12·1 answer
  • While rowing across a lake, John does 3960 ft-lbs of work over 120 ft. How much force is John using?
    13·1 answer
  • Definition of ceramics
    13·2 answers
  • a) At a particular company, employees are rated at the end of each year. The rating scale begins at 0.0, with higher values indi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!