GRANNY QUILT COSTS
1.0 OVERVIEW
Grannies for Peace want to sew a giant quilted Peace Symbol to display on International Peace Day. Their design calls for a large circle of quilted fabric, buttons to attach for the peace symbol, and fringe around the outside of the circle. They are trying to determine how large a circle they can build and stay within their budget. Their costs are the cost of fabric, buttons, and fringe. They have decided on what buttons they want to use, which are one inch in diameter and cost two cents each. They will need enough buttons for a length of four times the radius. They have decided on what fringe they want to use, which cost twenty cents per foot. They will need enough fringe to ring the circumference of the circle. The unknowns in their computation are the diameter of the circle, the cost of fabric, and the number of people who will be sewing. Write a program to assist with their computations, as specified below.
2.0 INPUT REQUIREMENTS
2.1 Diameter of a circle, in feet. (integer)
2.2 Fabric cost per square foot, in cents (integer)
2.3 The number of people that will be sewing the quilt. (integer).
3.0 OUTPUT
REQUIREMENTS
3.1 Area
of the circle (displayed with two decimal
places. Use a placeholder of %.2f).
3.2 Circumference of the circle (displayed
with two decimal
places.)
4.0 FUNCTIONAL REQUIREMENTS
4.1 Obtain the circle diameter, fabric unit cost, and number of people from the user.
4.2 Compute the circle area, using the formulas:
Radius = diameter / 2
Area
= Pi * radius * radius
Circumference
= Pi * 2 * radius
4.3 Compute the total cost which includes fabric, button, and fringe costs.
Total cost = (Fabric unit cost * area) + (cost of one button * 12 * (Radius * 4)) + ( Fringe cost per foot * Circumference).
4.5 Compute the fraction of the total cost that each person should pay.
4.7 Display the results: area, circumference, total cost, and cost per person.
5.0
IMPLEMENTATION CONSTRAINT
Button
cost and Fringe cost must be coded as constants.
Diameter, fabric cost, and number of people must be coded as integer
variables.
Assumptions
Input data will contain no characters.
Input data will contain only positive numbers.
Only integer values will be entered for integer variables.
Pi is 3.141593 since float has only six significant
digits.
SAMPLE EXECUTION
(Values shown below in bold face are data entered by the user).