Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

question 7 and 8 Note that the variable used at the command line has the name SRadius, while that in the function is Radius. Why

question 7 and 8
image text in transcribed
Note that the variable used at the command line has the name SRadius, while that in the function is Radius. Why does it not matter that these variables have different names? When octave is assigned a variable to sticks to that variable throughout the whole function till it ends atheist why it is important to chose wisely. 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 r2) as output argument. Paste the function code below. def SphereArea ( ): return (4*22*r*r)/7 print (Sphere Area (5)) 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. SA=Sphere Area(2) 7. Design an algorithm in pseudocode for a program (script file) that will prompt a user for the radius value, call each of the functions, and then output the values of surface area, volume, and surface to volume ratio (all formatted to 2 decimal places). 8. Program your algorithm, and paste the code for the main program below. Your program must contain the lines of code indicated below, exactly as written

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

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions