Equality check: Number of bricks Write an if statement that assigns deliveryComplete with 1 if bricksDelivered is equal to bricksExpected. Function e H Save C Reset I MATLAB Documentation 1 function deliveryComplete = CheckDelivery(bricksDelivered, bricksExpected) deliveryComplete = 0; % 0: Number of bricks delivered does not match expected 2 % 1 indicates number of bricks delivered matches expected 4 5 % Write an if statement that assigns deliveryComplete with 1 6 % if bricksDelivered is equal to bricksExpected deliveryComplete = 1; 8 9 end

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please answer in matlab code.

Equality check: Number of bricks
Write an if statement that assigns deliveryComplete with 1 if bricksDelivered is equal to bricksExpected.
Function e
Save
C Reset
MATLAB Documentation
1 function deliveryComplete
CheckDelivery(bricksDelivered, bricksExpected)
%3D
2
deliveryComplete
= 0;
% 0: Number of bricks delivered does not match expected
% 1 indicates number of bricks delivered matches expected
4
% Write an if statement that assigns deliveryComplete with 1
% if bricksDelivered is equal to bricksExpected
7
deliveryComplete
= 1;
8
9 end
Transcribed Image Text:Equality check: Number of bricks Write an if statement that assigns deliveryComplete with 1 if bricksDelivered is equal to bricksExpected. Function e Save C Reset MATLAB Documentation 1 function deliveryComplete CheckDelivery(bricksDelivered, bricksExpected) %3D 2 deliveryComplete = 0; % 0: Number of bricks delivered does not match expected % 1 indicates number of bricks delivered matches expected 4 % Write an if statement that assigns deliveryComplete with 1 % if bricksDelivered is equal to bricksExpected 7 deliveryComplete = 1; 8 9 end
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 e
A Save
C Reset
MATLAB Documentation
1 function safetyCheck
Cargolimit(passengerWeight, cargoWeight)
%3D
2 % passengerWeight: Total passenger weight (pounds)
3 % cargoweight: Total cargo weight (pounds)
4
5
maxWeight = 500;
% Maximum weight allowed
% Assigns safetyCheck with 1 if the sum of passengerWeight and cargoWeight is less
7
8
% than or equal maxWeight. Otherwise, assign safetyCheck with 0
9
safetyCheck
1;
%D
10
11 end
Transcribed Image Text: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 e A Save C Reset MATLAB Documentation 1 function safetyCheck Cargolimit(passengerWeight, cargoWeight) %3D 2 % passengerWeight: Total passenger weight (pounds) 3 % cargoweight: Total cargo weight (pounds) 4 5 maxWeight = 500; % Maximum weight allowed % Assigns safetyCheck with 1 if the sum of passengerWeight and cargoWeight is less 7 8 % than or equal maxWeight. Otherwise, assign safetyCheck with 0 9 safetyCheck 1; %D 10 11 end
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education