Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
Using Python
**program5_2.py**

Write a 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 a radius as its only argument. The low and high values for the range of random radii are specified by **user inputs** in main. The main function should then use these high and low values and the random module in a loop to generate 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 characters. wide with 2 decimals**.

**Sample Output**

```
Enter a low integer for the random radii 30
Enter a high integer for the random radii 90

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.47
  86.0        540.354      23235.82
  41.0        257.611       5281.02
  75.0        471.239      17671.46
  41.0        257.611       5281.02
  85.0        534.071      22698.01
  69.0        433.540      14957.12
```
expand button
Transcribed Image Text:**program5_2.py** Write a 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 a radius as its only argument. The low and high values for the range of random radii are specified by **user inputs** in main. The main function should then use these high and low values and the random module in a loop to generate 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 characters. wide with 2 decimals**. **Sample Output** ``` Enter a low integer for the random radii 30 Enter a high integer for the random radii 90 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.47 86.0 540.354 23235.82 41.0 257.611 5281.02 75.0 471.239 17671.46 41.0 257.611 5281.02 85.0 534.071 22698.01 69.0 433.540 14957.12 ```
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education