write a python program that prints a 3 column table showing the circumference and area of ten circles of a specified random radius

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

write a python program that prints a 3 column table showing the circumference and area of ten circles of a specified random radius. see sample output. the area and circumference are calculated and printed by a custom function that takes radius as its only arguement. the low and high values for the range of random radii are specifiedby user inputs in main. the main function should then use these high and low values and the random module in a loop to genrrate random integers and execute the custom function with the random integers as radii. in the table, the radius column should be 6 charas. wide with 1 decimal, the circumference column should be 12 charas. wide with 3 decimals, and the area column should be 11 charas. wide with 2 decimals.

### Educational Resource: Calculating Circle Properties

#### Program Output Example

This program demonstrates how to calculate the circumference and area of circles with random radii. Users provide a range for the radius, and the program generates random values within that range.

#### Inputs:
- **Low Integer for Random Radii:** 30
- **High Integer for Random Radii:** 90

#### Output Format:
The output displays three columns:
1. **RADIUS** - The randomly generated radius of the circle.
2. **CIRCUMFERENCE** - The calculated circumference of the circle, formatted to display with two decimal places.
3. **AREA** - The calculated area of the circle, presented with two decimal places.

The columns have specific formatting requirements:
- Radius: 6 characters wide with 1 decimal place.
- Circumference: 11 characters wide with 3 decimal places.
- Area: 11 characters wide with 2 decimal places.

#### Sample Output:

```
RADIUS  CIRCUMFERENCE       AREA
  75.0          471.239    17671.46
  70.0          439.823    15393.80
  59.0          370.708    10935.88
  52.0          326.726     8494.87
  41.0          257.611     5281.02
  85.0          534.071    22698.01
  69.0          433.540    14957.12
```

#### Program Code:
- **Filename:** `program5_3.py`

The program includes a main function and a custom module to execute the necessary calculations. The function accepts high and low values to generate random radius values and computes the corresponding circle properties.

This example illustrates the practical application of mathematical formulas to compute geometric properties, and demonstrates formatting techniques for displaying numerical data in a structured format.
Transcribed Image Text:### Educational Resource: Calculating Circle Properties #### Program Output Example This program demonstrates how to calculate the circumference and area of circles with random radii. Users provide a range for the radius, and the program generates random values within that range. #### Inputs: - **Low Integer for Random Radii:** 30 - **High Integer for Random Radii:** 90 #### Output Format: The output displays three columns: 1. **RADIUS** - The randomly generated radius of the circle. 2. **CIRCUMFERENCE** - The calculated circumference of the circle, formatted to display with two decimal places. 3. **AREA** - The calculated area of the circle, presented with two decimal places. The columns have specific formatting requirements: - Radius: 6 characters wide with 1 decimal place. - Circumference: 11 characters wide with 3 decimal places. - Area: 11 characters wide with 2 decimal places. #### Sample Output: ``` RADIUS CIRCUMFERENCE AREA 75.0 471.239 17671.46 70.0 439.823 15393.80 59.0 370.708 10935.88 52.0 326.726 8494.87 41.0 257.611 5281.02 85.0 534.071 22698.01 69.0 433.540 14957.12 ``` #### Program Code: - **Filename:** `program5_3.py` The program includes a main function and a custom module to execute the necessary calculations. The function accepts high and low values to generate random radius values and computes the corresponding circle properties. This example illustrates the practical application of mathematical formulas to compute geometric properties, and demonstrates formatting techniques for displaying numerical data in a structured format.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education