Explanation of Solution
The following pseudocode is to calculate the area and price per square of 12 and 14 inch pizzas.
Pseudocode:
- Define the constant values.
- Calculate the area of 12 inch pizza.
- Calculate the area of 14 inch pizza.
- Calculate the price per square of 12 inch pizza.
- Calculate the price per square of 14 inch pizza.
- Display the results on the screen.
Formula:
The following formula used to calculate the price per square of 12 and 14 inch pizzas:
//calculate the area of 12 inch pizza
area_12_inch=PI_VALUE*pow((12/2),2);
//calculate the area of 14 inch pizza
area_14_inch=PI_VALUE*pow((14/2),2);
//calculate the price per square in 12 inch pizza
price_12_inch=INCH_12/area_12_inch;
//calculate the price per square in 14 inch pizza
price_14_inch=INCH_14/area_14_inch;
Program:
The following code is to calculate the price per square of 12 and 14 inch pizzas:
//Include the required headers files
#include <iostream>
#include<cmath>
#include<iomanip>
using namespace std;
//main method
int main()
{
//define the constant values
const double PI_VALUE=3...
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Starting Out with C++: Early Objects
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education