Question

In: Computer Science

Write a program that calculates the cost per square inch of a circular pizza, given its...

Write a program that calculates the cost per square inch of a circular pizza, given its diameter and price. The formula for area of a circle is

Solutions

Expert Solution

code:

#include<math.h>
#include <stdio.h>

int main()
{
float diameter,area,radius,cost,price;
printf("Enter the diameter of pizza: ");
scanf("%f",&diameter);
printf("Enter the price of pizza: ");
scanf("%f",&price);
radius=diameter/2;
area=(22/7*radius*radius);
cost=price/area;
printf("cost per inch is :%.2f",cost);
return 0;
}

If you code in any langauge (python,c++,java) comment me i will edit my answer.


Related Solutions

Write a program that calculates the mean, median and mode of a given array in the...
Write a program that calculates the mean, median and mode of a given array in the following manner: i) Write three functions mean (), median () and mode () that calculates the mean, median and mode of an array. ii) Using these functions write a program that calculates all the three above mentioned values for two different arrays A and B where A is an array that contains the number of hours spent by a person each day for playing...
Create a program in java that calculates area and perimeter of a square - use a...
Create a program in java that calculates area and perimeter of a square - use a class and test program to calculate the area and perimeter; assume length of square is 7 ft.
Write a python program that calculates the average number of words per sentence in the input...
Write a python program that calculates the average number of words per sentence in the input text file. every sentence ends with a period (when, in reality, sentences can end with !, ", ?, etc.) and the average number of sentences per paragraph, where a paragraph is any number of sentences followed by a blank line or by the end of the text.
Write a Java Program to place a pizza ordering program. It creates a pizza ordered to...
Write a Java Program to place a pizza ordering program. It creates a pizza ordered to the specifications that the user desires. It walks the user through ordering, giving the user choices, which the program then uses to decide how to make the pizza and how much the cost of the pizza will be. Note: Use dialog boxes for communicating with the user. Remember to use the JOptionPane class which is the graphical user interface (GUI) and Comments that are...
Write a Java Program to place a pizza ordering program. It creates a pizza ordered to...
Write a Java Program to place a pizza ordering program. It creates a pizza ordered to the specifications that the user desires. It walks the user through ordering, giving the user choices, which the program then uses to decide how to make the pizza and how much the cost of the pizza will be. Note: Use dialog boxes for communicating with the user. Remember to use the JOptionPane class which is the graphical user interface (GUI) and Comments that are...
Please use Phyton to write a program: Write a program that calculates and displays the total...
Please use Phyton to write a program: Write a program that calculates and displays the total bill at a restaurant for a couple that is dining. The program should collect from the couple, cost of each meal, and the percentage of the final cost that they would like to tip. The sales tax in the state where the restaurant exists is 7.5%. Display to the user, line by line: Total Cost of Both Meals Sales Tax in dollars Tip in...
  A concrete mix is designed to withstand 3000 pounds per square inch​ (psi) of pressure. The...
  A concrete mix is designed to withstand 3000 pounds per square inch​ (psi) of pressure. The following data represent the strength of nine randomly selected casts​ (in psi). ​3970 4090 3000 2950 3840 4090 4040 3490 Compute the​ mean, median and mode strength of the concrete​ (in psi).
A concrete mix is designed to withstand 3000 pounds per square inch​ (psi) of pressure. The...
A concrete mix is designed to withstand 3000 pounds per square inch​ (psi) of pressure. The following data represent the strength of nine randomly selected casts​ (in psi). 3960​, 4090​, 3200​, 3000​, 2950​, 3830​, 4090​, 4040​, 3780    Compute the​ mean, median and mode strength of the concrete​ (in psi). Compute the mean strength of the concrete. Select the correct choice below​ and, if​ necessary, fill in the answer box to complete your choice. A.The mean strength of the concrete...
The data set contains the compressive strength, in thousands of pounds per square inch (psi), of...
The data set contains the compressive strength, in thousands of pounds per square inch (psi), of 30 samples of concrete taken two and seven days after pouring. Sample Two Days Seven Days 1 2.830 3.505 2 3.295 3.430 3 2.710 3.670 4 2.855 3.355 5 2.980 3.985 6 3.065 3.630 7 3.765 4.570 8 3.265 3.700 9 3.170 3.660 10 2.895 3.250 11 2.630 2.850 12 2.830 3.340 13 2.935 3.630 14 3.115 3.675 15 2.985 3.475 16 3.135 3.605...
write a program to calculate and print payslips write program that calculates and prints payslips. User...
write a program to calculate and print payslips write program that calculates and prints payslips. User inputs are the name of employee, numbers of hours worked and hourly rate c++ language
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT