Question: Although MATLAB does not have this problem, write a script that will prompt the user for a number and then output its square root using

  1. Although MATLAB does not have this problem, write a script that will prompt the user for a number and then output its square root using an fprintf statement with the following format: The square root of 36 is 6.00. If the user enters a negative number, your program should calculate the square root of its absolute value, and then use an fprintf statement that includes the character i to get: The square root of -36 is 6.00i Create and evaluate a program that uses an if-else structure to accomplish these objectives. Enter your script code, as well as the command line input and output below. Be sure to test your program to evaluate that it is working properly. Show the input and output of your evaluation.
  2. Create a program that prompts a user for a number, and outputs Your number is positive., Your number is negative., or Your number is zero. As appropriate. Create and evaluate a program that uses an if-elseif-else structure to accomplish this objective.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!