Question
In Unix: Copy the filesfrom~cs252/Assignments/sqrt/into your newly created directory. (Do not copy thesqrtdirectory itself.) Compile the code, capturing the error messages by any of the
In Unix:
Copy the filesfrom~cs252/Assignments/sqrt/into your newly created directory. (Do not copy thesqrtdirectory itself.)
Compile the code, capturing the error messages by any of the techniques covered in this module's lesson.
Fix any errors that you encounter. Continue compiling and fixing until you are able to produce an executable program namedcomputeSqrt.
- Each error can be fixed by a change of no more than 2 characters on a a single line each. If you find yourself doing anything more complicated,stop! (You may well be giving incorrect compilation commands.)
This program computes square roots of positive numbers. It expects to receive a floating point number as a command line parameter when run, e.g.,
Test the program on a few numbers to be sure it works.
Make a shell script namedsqrts.shthat will take a list of numbers as command line parameters and will runcomputeSqrton each of them in turn, however many there are.
For example, the output of
should be
2.5 5 10
./sqrts.sh 6.25 25 100
./computeSqrt 6.25
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started