Answer the following questions for the problem listed below

Answer the following questions for the problem listed below. What are the inputs? What format are they in? (e.g., integer, floating-point, character, or string) What is the valid range (if any) of each input? How do you get from inputs to the outputs you want (process)? To follow these steps, what else do you need? Other variables, constants, conversion? (besides input and output variables) Libraries (e.g., for calculations). What are the outputs? What format are they in? Clothing stores sometimes have sales during the year to attract customers and clear inventory. Calculate the final sale price of an item by deducting the sale percentage from the original price and then adding the tax percentage.

Solution

At first, we take three inputs: Original Price of the item, Sale percentage i.e., discount offer, Tax percentage.

It is a known fact that the MATLAB does not require any datatype declaration. whatever the numerical value we offer as input, it will read the value and assign accordingly. At some cases, if we need to explicitly declare the variables it\'s better to take them in float variables, since Values of these inputs may be in decimals.

Now, we are representing \'x\' to read the original price of the item, \'y\' to read sale percentage i.e., Discount offer, \'z\' to read tax percentage being imposed on the item.

After reading them, we\'ll calculate amount being discounted by sale percentage which is represented by \'s\'. Later, we\'ll calculate Current rate of the item = Original price - amount being discounted[s], this is held by \'crate\'. Now we\'ll calculate tax percentage represented by \'tax\'. Finally we calculate final sale price of the item represented by \'final\'.

Matlab code for the process is:

disp(\'Please Enter \');
x = input(\'Original Price:\');
y = input(\'sale Percentage:\');
z = input(\'Tax Percentage:\');
s = y*x/100;
crate = x-s;
tax = z*crate/100;
final = crate+tax;
disp(final);

The Last statement : disp(final); displays final price of the item on screen

 Answer the following questions for the problem listed below. What are the inputs? What format are they in? (e.g., integer, floating-point, character, or string

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site