Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will compare cost per square inch of two different diameters of Pizza and prints which pizza the user should buy Problem:

Write a program that will compare cost per square inch of two different diameters of Pizza and prints which pizza the user should buyimage text in transcribedimage text in transcribedimage text in transcribed

Problem: Write a program that will compare cost per square inch of two different diameters of Pizza and prints which pizza the user should buy. Our aim is to make the user buy cheaper pizza. Sample Output: Enter diameter of Dominoes pizza (inches) 10 Enter cost of Dominoes pizza: 15.65 Enter diameter of Pizza Hut pizza (inches)10 Enter cost of Pizza Hut pizza: 18.54 Buy Dominoes Pizza for $15.65!! Enter diameter of Dominoes pizza (inches) : 10 Enter cost of Dominoes pizza: 15.65 Enter diameter of Pizza Hut pizza (inches) 10 Enter cost of Pizza Hut pizza: 15.65 Buy Any Pizza for $15.65!! How to submit your program: Instructions: .Add Comments wherever required. Your program should take integer values for diameter variable and double values for cost. You should use only one function to calculate the cost of pizza. Your function must have function declaration. [You must define your function after main0] The function should return cost per square inch value to variables in main function, then you should compare both the costs to check which one is cheaper. For calculating cost per square inch, you have to convert diameter to radius and perform area of circle. Then you have to divide price by area to get cost per square inch of that pizza. Print it in the same format as sample output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago