Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. (a) (15 marks) A stone is an imperial unit of mass. Create in MATLAB a function (a single file containing this function) that converts

image text in transcribed
2. (a) (15 marks) A stone is an imperial unit of mass. Create in MATLAB a function (a single file containing this function) that converts kg to stone. The function input argument should be an amount in kg, and the output argument should be the same amount but now in stone. Note that 1 stone equals 6.35029 kg. (b) (10 marks) Modify the function, so that the function returns two numbers: the integer amount (rounded down) in stone and the remaining amount in pounds. Note that there are 14 pounds in one stone. Hence 2.5 stone would become 2 stone and 7 pounds. (c) (5 marks) Create a test script that calls the previous function and tests it for known values. of the expected results are not returned, an error message shoqld be displayed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

Compare the current team to the ideal team.

Answered: 1 week ago