Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Volume of a Cube Type a program that computes volume V of a cube with sides of length L = 4cm and prints the result

 Volume of a Cube

Type a program that computes volume V of a cube with sides of length L = 4cm and prints the result to the screen. Both V and L should be defined as separate variables in the program.


Question 2: Area and Circumference of a Circle

Type a program that computes both the circumference C and the area A of a circle with radius r = 2 cm. The variables C, A and r should all be defined as separate variables in the program.


Question 3: Volumes of Three Cubes

We are interested in the volume V of a cube with length L: V = L3, computed for three different values of L. a) In a program, use the np.array function to compute and print three values of L, equally spaced on the interval [1, 3]. b) Carry out, by hand, the computation V = L3 when L is an array with three elements. That is, compute V for each value of L. c) Modify the program in a), so that it prints out the result V of V = L**3 when L is an array with three elements as computed by np.array. Compare the resulting volumes with your hand calculations.


Question 4: Array Data

Assume four members of a family with heights 1.60 m, 1.85 m, 1.75 m, and 1.80 m. Their weights are 100 kg, 120 kg, 80 kg, 75 kg, respectively. Using the BMI formula, BMI = weight (kg) / [height (m)]2, to calculate their BMI index. Use np.array.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

First make sure you have NumPy installed for the third and fourth questions as NumPy is used for arr... 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

Recommended Textbook for

Mathematical Applications for the Management Life and Social Sciences

Authors: Ronald J. Harshbarger, James J. Reynolds

11th edition

9781337032247, 9781305465183, 1305108043, 1337032247, 1305465180, 978-1305108042

More Books

Students also viewed these Programming questions

Question

Draw a labelled diagram of the Dicot stem.

Answered: 1 week ago

Question

Find the second derivatives. 1. y = x - x2 2. y = x4 - 1/x

Answered: 1 week ago

Question

22. Why is tPA not helpful in cases of hemorrhagepg109

Answered: 1 week ago