Complete the program below so that it computes the price of a piece of glass. Pieces of glass are usually priced based on the type of glass and the area of the piece, but there is a minimum charge of $2.00. For clear glass (glass type 1), the charge is $6.00 per square meter; for frosted glass (type 2), the price is $10.00 per square meter. For example, the cost of a 0.25-square-meter piece of clear glass is $2.00 since 0.25 * $6.00 is $1.50, an amount less than the minimum charge. The price of a 2.4-square-meter piece of frosted glass is $24.00 (2.4 * $10.00). You do not need to do error checking in the program.
```
#include
#define CLEAR 1
#define SQMETER_CLEAR 6.00
#define FROSTED 2
#define SQMETER_FROSTED 10.00
#define MINIMUM 2.00
int
main(void)
{
double price, area;
int type;
printf("Enter glass type: %d (clear) or %d (frosted)> ",
CLEAR, FROSTED);
scanf("%d", &type);
printf("Enter area in square meters> "):
scanf("%lf", &area);
```
```
if (type == CLEAR)
price = area * SQMETER_CLEAR;
else
price = area * SQMETER_FROSTED;
if (price < MINIMUM)
price = MINIMUM;
printf("Glass price is $%.2f\n", price);\
return (0);
}
```
You might also like to view...
Match the following portable storage device terms to their descriptions:
I. CD-R A. A disk for very large amounts of data that is available in recordable or reusable format. II. CD-RW B. A type of permanent storage. III. DVD C. A disk that may be written upon but not erased. IV. Flash drive D. A small rectangular port or connection found on the front of many computers. V. USB E. A disk that may be written upon, erased, and reused.
During which phase of goals-based strategic planning, a multitude ofdata is gathered about internal processes and operations, including survey data from customersand suppliers and other objective assessments of an organization?
a. Analyze situation phase b. Set direction phase c. Define strategies phase d. Deploy plan phase