PLEASE ANSWER USING MATLAB SYNTAX AND LANGUAGE. You are working for a city, and want to set up a system for better understanding the needs of the busses running on certain routes. Using demographic data and technical specifications of busses, the city has created data structures for each city bus with the following properties that do not change: bus.mass – The mass of the buss bus.passMass – The average mass of a passenger on a route bus.engine – The amount of force the bus’s engine puts out per unit mass In addition, you have added the following property to the structure for simulation purposes. This property can change: bus.numPass – The number of passengers on the bus. Procedure The city wants you to do some calculations on the amount of work buses have to do on bus routes, given the number of passengers entering and leaving busses. You will write a function called busSim that will take the following inputs: bus – A structure with the format defined above. You can assume that it will start with a certain number of passengers on board. passOn – An array that contains only integers. This is the number of passengers that get on at each stop. passOff – An array that contains only integers and is the same length as passOn. This is the number of passengers that get off at each stop. distance – An array that contains real numbers that is the same length as passOn containing the distance the bus has to travel after each bus stop to get to the next stop. It should return the following ouputs: bus – An updated version of the input structure with the final number of passengers. passRecord – An array with the same length ad passOn with the number of passengers after each bus stop. totalWork – A real number that is the total amount of work the bus’s engine has had to put out on the entire trip. You can assume that passengers will board and leave the bus at the first stop before you have to make the first work calculation. You should therefore make as many work calculations as there are elements in each of the input arrays. Additional Code – Data Entry Errors Your function should work with any inputs that are of the correct input data types, even if they contain errors. You should handle those errors in the following ways: - If your input arrays are not all the same length you should only do calculations up to the index of the shortest array. - If the number of passengers would ever go below 0, it should instead be set to 0. - If the number of passengers would ever be a non-integer value, it should instead be rounded up to the nearest integer. - If a distance is listed as negative, treat it as positive You can assume the following and do not have to check for them: - Masses will always be positive - Engines will always put out positive force - The numbers in passOn or passOff will always be non-negative
PLEASE ANSWER USING MATLAB SYNTAX AND LANGUAGE. You are working for a city, and want to...
Before reading this assignment, remember that the Guide to Mini Projects is ALWAYS part of the instructions for EVERY Mini Project Assignment. Please go back and read it before beginning. Mini Project #2 – Bus Routes Introduction You are working for a city, and want to set up a system for better understanding the needs of the busses running on certain routes. Using demographic data and technical specifications of busses, the city has created data structures for each city bus...
Question D
C. In Regular Bus City, there is a shuttle bus that goes between Stop A and Stop B, with no stops in between. The bus is perfectly punctual and arrives at Stop A at precise five minute intervals (6:00, 6:05, 6:10, 6:15, etc.) day and night, at which point it immediately picks up all passengers waiting. Citizens of Regular Bus City arrive at Stop A at Poisson random times, with an average of 5 passengers arriving every minute,...
Description An array in C++ is a collection of items stored at contiguous memory locations and elements can be accessed randomly using indices of an array. They are used to store similar type of elements as in the data type must be the same for all elements. One advantage of arrays is easy data manipulation and accessibility of elements stored in consecutive locations. The Problem: One teaching assistant of a computer science department in Engineering University got a simple question...
Language is in Java, please explain the answer using comments, Thank you. I always rate!!! PLEASE DO NOT import any packages to solve the problem. PLEASE use classes and methods from java.lang.*, since they are automatically imported without import statement. build a method called; public static in[] multbygrp(int[] elems, int grpsize) This method splits arr into subgroups of (equal) size groupSize, and multiply the contents of each subgroup. It returns the individual product in a new list. If splitting can't...
Number of Numbers (10 pts) For this assignment you will be working with arrays. Open a new Java project called Nums Prompt a user to enter in the length of the array (the number of numbers). Enter the number of numbers: Use this information to declare an array of the user-specified length. Next, using a for loop, prompt the user to enter that many numbers, and store each one in your array until your array is at full capacity. Using...
Using MATLAB. As an engineer working on designing and modelling a new drone product, you are doing a lot of different physics calculations. Your boss wants to write a program that can choose from an assortment of calculations and perform the desired physics calculation in order to streamline the design and modelling process. For this project you will write a function called PhysicsCalc. inputs Your function should take three inputs in the following order: var1–The first number in the calculation...
Can someone solve number 5 using Matlab?
In Class Exercises 8-Arrays For the following exercises, assume an array is already populated, your job is to write a program that traverses the array. DO NOT HARD CODE the last index. In other words, you code for 1-4&6 should be able to handle the following 2 arrays: amp2 10 array1 [52, 63, 99, 71, 3.1] array2 - [99:-3: 45); For 5: wordArray1 wordArray2 ('number, 'arrays', 'indices', 'hello', finish' [number, 'different, 'finish? 1....
using matlab
In Class Exercises 8-Arrays For the following exercises, assume an array is already populated, your job is to write a program that traverses the array. DO NOT HARD CODE the last index. In other words, you code for 1-4&6 should be able to handle the following 2 arrays: amp2 10 array1 [52, 63, 99, 71, 3.1] array2 - [99:-3: 45); For 5: wordArray1 wordArray2 ('number, 'arrays', 'indices', 'hello', finish' [number, 'different, 'finish? 1. Determine the sum of all...
Please Use C++ Language. Thank you. Please I need the actual code. Donot post psudocode!! And also I have codes but just donot work so make sure that it works. Requested files: CrosswordGenerator.cpp, CrosswordGenerator.h, CrosswordGenerator_test.cpp CrosswordGenerator - Write a program that helps to generate a crossword puzzle by organizing words that share letters. For this assignment, you will write a program that forms the basis of a crossword puzzle generator. In order to create a crossword puzzle you need to...
Implement and compare sorting algorithms. The task is to sort a list of integers using 5 sorting algorithms: selection sort insertion sort merge sort heap sort quicksort Your program should include 5 separate sorting methods, though it is fine for them to call some common methods (like "swap") if needed. Each sorting method should also count the number of comparison operations and assignment operations on the array elements during the sorting process. In the main program, two types of array...