Welcome to Westonci.ca, your one-stop destination for finding answers to all your questions. Join our expert community now! Explore a wealth of knowledge from professionals across different disciplines on our comprehensive platform. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.
Sagot :
Using the knowledge in computational language in python it is possible to write a code that write an if statement that assigns deliverycomplete with 1 if bricksdelivered is equal to bricksexpected.
Writting the code:
%Define the function CheckDelivery()
function deliveryComplete = CheckDelivery( brickDelivered, bricksExpected)
%Start the if-else statements to check if delievery is completed.
%Delievery completed
if ( brickDelivered == bricksExpected)
deliveryComplete = 1;
%Delievery not completed.
else
deliveryComplete = 0;
%End of if-else
end
%Print the result.
fprintf("deliveryComplete: %d\n",deliveryComplete);
%End of the function.
end
%demo.m
%Call the function for the output 0.
CheckDelivery(10,11);
%Call the function for the output 1.
CheckDelivery(10,10);
function deliveryComplete = CheckDelivery(bricksDelivered, bricksExpected)
deliveryComplete = 0;
if bricksDelivered == bricksExpected
deliveryComplete = 1;
end
end
See more about python at brainly.com/question/18502436
#SPJ1
We appreciate your time. Please revisit us for more reliable answers to any questions you may have. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Westonci.ca is committed to providing accurate answers. Come back soon for more trustworthy information.