Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use Matlab Please show a clear script and dont use section only function. Make a

ID: 3903128 • Letter: U

Question

Use Matlab Please show a clear script and dont use section only function. Make a FUNCTION that has your name (or mixture of their names) and do the following (value: 50 POINTS): An organizer must know how many buses (guaguas) he must dispatch to an event depending on the number of people and number of bus seats. Remember that if the result has decimals, the amount of buses should be approximated above. The system should also warn you how many chairs will be empty. Buses = people / chairs that the bus has Chairs that are left over = buses * chairs of each bus - people There must be 2 inputs and 2 outputs that would be: 1.1. tickets: number of people and number of seats per bus (let's assume that ALL buses are same). 1.2. Departures: the number of buses to be used and the number of seats that were left over.

Explanation / Answer

ScreenShot

----------------------------------------------------

Code

%Initialize variables
pCount=0;
sNo=0;
%function return number of buses neede and remaining seats
function [numberOfBuses,remCount]=calculate(pCount,sNo)
numberOfBuses=round(pCount/sNo);
remCount=(numberOfBuses*sNo)-pCount;
end
%user input prompts
pCount=input("Enter the count of people:");
sNo=input("Enter the seat number:");
%call function
[busCount,remainSeat]=calculate(pCount,sNo)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote