Discover the answers you need at Westonci.ca, where experts provide clear and concise information on various topics. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our 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 on our site. Don't hesitate to return whenever you have more questions or need further clarification. Thanks for stopping by. We strive to provide the best answers for all your questions. See you again soon. We're glad you visited Westonci.ca. Return anytime for updated answers from our knowledgeable team.