Question: MATLAB 4. Write a program capable of converting a value of pressure from an initial unit to a new unit. Ask the user to enter
4. Write a program capable of converting a value of pressure from an initial unit to a new unit. Ask the user to enter both a value for pressure as well as the unit of the value. Also ask the user what their preferred unit of pressure is. (Ex: The user has a value of 50 psi, and they want you to convert this to kilo- Pascals.) Your program should be able to convert between 3 different possible units of pressure: "kPa" (kiloPascals), "psi" (pounds per square inch), and "bar". Once the conversion is complete, display the sentence XXX.X UNITS was converted to XXX.X UNITS , where the 1st UNITS is the word that refers to the initial input unit (kPa, psi, or bar), and the 2nd UNITS refers to the converted unit. Your program should account for the fact that the user could potentially choose the same unit twice. (They could ask you to convert psi to psi.) Feel free to use the menu command instead of input command for the user choice of units. You can find the conversions between kPa, psi, and bar on the internet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
