Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

Who is the assigned manager for each tactic?

Answered: 1 week ago

Question

1. Discuss the five types of learner outcomes.

Answered: 1 week ago