Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

What is digital literacy? Why is it necessary?

Answered: 1 week ago