Exercise 2: Write a program that calculates the cost per square inch of a circular pizza, given its diameter and price. The formula for area is A = ar² .

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 13PE
icon
Related questions
Question
Python
Exercise 2: Write a program that calculates the cost per square inch of a circular pizza, given its
diameter and price. The formula for area is A = rr²
US V O 9:02
DII
LI
Transcribed Image Text:Exercise 2: Write a program that calculates the cost per square inch of a circular pizza, given its diameter and price. The formula for area is A = rr² US V O 9:02 DII LI
Expert Solution
Introduction

If "d" is the diameter of the circle then the radius of the circle is calculated as follows

diameter=2×radiusradius=diameter2

The area of the circle of radius, "r" is calculated using the following formula

area = π×radius2

where π=3.1415

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT