Question: Small aircraft weight limit Write an if - else statement that assigns safetyCheck with 1 if the sum of passengerWeight and cargoWeight is less than

Small aircraft weight limit
Write an if-else statement that assigns safetyCheck with 1 if the sum of passengerWeight and cargoWeight is less than or equal maxWeight. Otherwise, assign safetyCheck with 0.
Ex. If passengerWeight is 200, cargoWeight is 100, and maxWeight is 500, then safetyCheck is assigned with 1. If passengerWeight is 300, cargoWeight is 275, and maxWeight is 500, then safetyCheck is assigned with 0.
Function 0
Save
Reset
MATLAB Documentatic
function safetyCheck = Cargolimit(passengerWeight, cargoweight)
% passengerweight: Total passenger weight (pounds)
% cargoweight: Total cargo weight (pounds)
maxWeight =500;,% Maximum weight allowed
% Assigns safetycheck with 1 if the sum of passengerWeight and cargoweight is less
% than or equal maxWeight. Otherwise, assign safetycheck with 0
safetycheck =1;
end
Code to call your function
1 Cargolimit (200,100)
 Small aircraft weight limit Write an if-else statement that assigns safetyCheck

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!