
Concept explainers
Hello I need help this code is for MATLAB
the following functions with all the given input and write comments that what the function does
fix
floor
ceil
int32
round
roundn
try all the above functions for
3.111
3.5
3.999
-3.111
-3.5
-3.999

1. Create an array of input values [3.111, 3.5, 3.999, -3.111, -3.5, -3.999].
2. Initialize variables to store results for each function: fix_result, floor_result, ceil_result, int32_result, round_result, roundn_result.
3. Iterate through each input value in the array:
a. Apply the fix function to the current input value and store the result in fix_result.
b. Apply the floor function to the current input value and store the result in floor_result.
c. Apply the ceil function to the current input value and store the result in ceil_result.
d. Apply the int32 function to the current input value and store the result in int32_result.
e. Apply the round function to the current input value and store the result in round_result.
f. Apply the roundn function to the current input value with n = -1 and store the result in roundn_result.
4. Display the results for each function for all input values.
5. End.
Note:
In 3f, any value can be used for n. For example purpose n=-1 is taken here.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

- Create a function named fnTuition that calculates the tuition for a student. This function accepts one parameter, the student ID, and it calls the fnStudentUnits function that you created in task 2. The tuition value for the student calculated according to the following pseudocode: if (student does not exist) or (student units = 0) tuition = 0 else if (student units >= 9) tuition = (full time cost) + (student units) * (per unit cost) else tuition = (part time cost) + (student units) * (per unit cost) Retrieve values of FullTimeCost, PartTimeCost, and PerUnitCost from table Tuition. If there is no student with the ID passed to the function, the function should return -1. Code two tests: 1) a student who has < 9 student units, and 2) for a student who has >= 9 student units. For each test, display StudentID and the result returned by the function. Also, run supportive SELECT query or queries that prove the results to be correct.arrow_forwardWhat benefits can you get from using a function?\arrow_forwardWhat benefits can you get from using a function?\arrow_forward
- PHYTONarrow_forwardComplete the following TODO by defining a function called add_func(). Define a function called add_func() that takes two arguments. The function should adds the two arguments together using + and return the output. For example, if the input values for the arguments are 1 and 2, then 3 should be returned. Likewise, if the input arguments are "good" and " day", then "good day" should be returned. # TODO print(f"add_func output for 1 + 2: {add_func(1, 2)}") print(f"add_func output for good + day: {add_func('good',' day')}") todo_check([ (add_func(1,2) == 3,'add_func() did not return 3 when using input values 1 and 2.'), (add_func('good',' day') == "good day",'add_func() did not return "good day" when using input values "good" and " day"') ])arrow_forwardHello, I needed help with this JavaScript function Thanks. function _three(radius, height)Create a JavaScript function that meets the following requirements:• Receives two parameters, one representing a radius value, the other a height valueo The function can safely assume, all parameters passed are represented in meters (m).• The function calculates the volume of a cylinder and returns the value back to its caller.• The function always displays the calculated volume, rounded to two significant digits• The function displays the calculated information (console log) as illustrated below:• The function returns the calculated volume back to the callerarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





