SlideShare a Scribd company logo
Exercise 2: Implementing Geometry Formulas with functions (10 points) Implement the
following functions that return the volume and surface areas of 3D shapes: double
cone_volume(double r , double h ) ; // r = radius, h = height double cone_surface(double r ,
double h ) ; // r = radius, h = height double cube_volume(double a); // a = edge double
cube_surface(double a) ; // a = edge double sphere_volume(double r ) ; // r = radius double
sphere_surface(double r ) ; // r = radius double cylinder_volume(double r , double h ) ; // r =
radius, h = height double cylinder_surface(double r , double h ) ; // r = radius, h = height Write a
program that prompts the user to enter whether they have a cone, cube, sphere, or cylinder. - If
the user enters "cone", the program then prompts the user to enter two values: radius and height.
The program then calls the respective functions to print the volume and surface area of the cone.
- If the user enters "cube", the program then prompts the user to enter one value: edge length.
The program then calls the respective functions to print the volume and surface area of the cube.
- If the user enters "sphere", the program then prompts the user to enter one value: radius. The
program then calls the respective functions to print the volume and surface area of the sphere. - If
the user enters "cylinder", the program then prompts the user to enter two values: radius and
height. The program then calls the respective functions to print the volume and surface area of a
cylinder. - If the user enters anything other than cone, cube, sphere, or cylinder, print "Invalid
shape."

More Related Content

Similar to Exercise 2- Implementing Geometry Formulas with functions (10 points) (1).pdf

DSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdfDSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 
Business App Programming Course Project
Business App Programming Course ProjectBusiness App Programming Course Project
Business App Programming Course Project
Carmen Lampkin
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
graphitech
 
Modify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdfModify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdf
hullibergerr25980
 
Chapter10.pptx
Chapter10.pptxChapter10.pptx
Chapter10.pptx
RahulChaudhary51756
 
Application of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasadApplication of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasad
Shubham Prasad
 

Similar to Exercise 2- Implementing Geometry Formulas with functions (10 points) (1).pdf (6)

DSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdfDSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdf
 
Business App Programming Course Project
Business App Programming Course ProjectBusiness App Programming Course Project
Business App Programming Course Project
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
Modify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdfModify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdf
 
Chapter10.pptx
Chapter10.pptxChapter10.pptx
Chapter10.pptx
 
Application of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasadApplication of Derivative Class 12th Best Project by Shubham prasad
Application of Derivative Class 12th Best Project by Shubham prasad
 

More from karimshaikh24

Exercise- a growth model with no growth - Suppose the labor force is c.pdf
Exercise- a growth model with no growth - Suppose the labor force is c.pdfExercise- a growth model with no growth - Suppose the labor force is c.pdf
Exercise- a growth model with no growth - Suppose the labor force is c.pdf
karimshaikh24
 
Exercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdf
Exercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdfExercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdf
Exercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdf
karimshaikh24
 
Exercise 4 Suppose that there are now fees associated with foreign exc.pdf
Exercise 4 Suppose that there are now fees associated with foreign exc.pdfExercise 4 Suppose that there are now fees associated with foreign exc.pdf
Exercise 4 Suppose that there are now fees associated with foreign exc.pdf
karimshaikh24
 
Exercise 3-15-Design and implement aMinQueuedata structure that can st.pdf
Exercise 3-15-Design and implement aMinQueuedata structure that can st.pdfExercise 3-15-Design and implement aMinQueuedata structure that can st.pdf
Exercise 3-15-Design and implement aMinQueuedata structure that can st.pdf
karimshaikh24
 
Exercise 3 PYTHON Identify the most common words in the description of.pdf
Exercise 3 PYTHON Identify the most common words in the description of.pdfExercise 3 PYTHON Identify the most common words in the description of.pdf
Exercise 3 PYTHON Identify the most common words in the description of.pdf
karimshaikh24
 
Example 1- A recent study focused on the number of times men and women (1).pdf
Example 1- A recent study focused on the number of times men and women (1).pdfExample 1- A recent study focused on the number of times men and women (1).pdf
Example 1- A recent study focused on the number of times men and women (1).pdf
karimshaikh24
 
Examine the screenshot provided below- Check only the answers that are.pdf
Examine the screenshot provided below- Check only the answers that are.pdfExamine the screenshot provided below- Check only the answers that are.pdf
Examine the screenshot provided below- Check only the answers that are.pdf
karimshaikh24
 
Evidence that natural selection does not cause adaptation to match fut.pdf
Evidence that natural selection does not cause adaptation to match fut.pdfEvidence that natural selection does not cause adaptation to match fut.pdf
Evidence that natural selection does not cause adaptation to match fut.pdf
karimshaikh24
 
exactly 2 - Click on the icon to viens the binomial probabities table-.pdf
exactly 2 - Click on the icon to viens the binomial probabities table-.pdfexactly 2 - Click on the icon to viens the binomial probabities table-.pdf
exactly 2 - Click on the icon to viens the binomial probabities table-.pdf
karimshaikh24
 
Every year- natural disasters impact families- communities- nations- a.pdf
Every year- natural disasters impact families- communities- nations- a.pdfEvery year- natural disasters impact families- communities- nations- a.pdf
Every year- natural disasters impact families- communities- nations- a.pdf
karimshaikh24
 
Event A occurs with probability 0-055 - Event B occurs with probabilit.pdf
Event A occurs with probability 0-055 - Event B occurs with probabilit.pdfEvent A occurs with probability 0-055 - Event B occurs with probabilit.pdf
Event A occurs with probability 0-055 - Event B occurs with probabilit.pdf
karimshaikh24
 
Every process is identified by a process ID number (PID)- The very fir.pdf
Every process is identified by a process ID number (PID)- The very fir.pdfEvery process is identified by a process ID number (PID)- The very fir.pdf
Every process is identified by a process ID number (PID)- The very fir.pdf
karimshaikh24
 
Eve has intercepted a large cache of text that appears to be encrypted.pdf
Eve has intercepted a large cache of text that appears to be encrypted.pdfEve has intercepted a large cache of text that appears to be encrypted.pdf
Eve has intercepted a large cache of text that appears to be encrypted.pdf
karimshaikh24
 
Evaluate the significance of ROCE- Earnings per share and the overall.pdf
Evaluate the significance of ROCE- Earnings per share and the overall.pdfEvaluate the significance of ROCE- Earnings per share and the overall.pdf
Evaluate the significance of ROCE- Earnings per share and the overall.pdf
karimshaikh24
 
Even though Darwin came up with the theory of sexual selection over 15.pdf
Even though Darwin came up with the theory of sexual selection over 15.pdfEven though Darwin came up with the theory of sexual selection over 15.pdf
Even though Darwin came up with the theory of sexual selection over 15.pdf
karimshaikh24
 
Evaluate the relationship between population density and population di.pdf
Evaluate the relationship between population density and population di.pdfEvaluate the relationship between population density and population di.pdf
Evaluate the relationship between population density and population di.pdf
karimshaikh24
 
Estimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdf
Estimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdfEstimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdf
Estimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdf
karimshaikh24
 
Evaluate- n-11763n+2.pdf
Evaluate- n-11763n+2.pdfEvaluate- n-11763n+2.pdf
Evaluate- n-11763n+2.pdf
karimshaikh24
 
eternine whether the scathor diagram indicales that a linear relabion.pdf
eternine whether the scathor diagram indicales that a linear relabion.pdfeternine whether the scathor diagram indicales that a linear relabion.pdf
eternine whether the scathor diagram indicales that a linear relabion.pdf
karimshaikh24
 
estion li Question 3 If the probability distribution for the random va.pdf
estion li Question 3 If the probability distribution for the random va.pdfestion li Question 3 If the probability distribution for the random va.pdf
estion li Question 3 If the probability distribution for the random va.pdf
karimshaikh24
 

More from karimshaikh24 (20)

Exercise- a growth model with no growth - Suppose the labor force is c.pdf
Exercise- a growth model with no growth - Suppose the labor force is c.pdfExercise- a growth model with no growth - Suppose the labor force is c.pdf
Exercise- a growth model with no growth - Suppose the labor force is c.pdf
 
Exercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdf
Exercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdfExercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdf
Exercise 4- Separation of soil constituents by Mechanical Analysis- Ca.pdf
 
Exercise 4 Suppose that there are now fees associated with foreign exc.pdf
Exercise 4 Suppose that there are now fees associated with foreign exc.pdfExercise 4 Suppose that there are now fees associated with foreign exc.pdf
Exercise 4 Suppose that there are now fees associated with foreign exc.pdf
 
Exercise 3-15-Design and implement aMinQueuedata structure that can st.pdf
Exercise 3-15-Design and implement aMinQueuedata structure that can st.pdfExercise 3-15-Design and implement aMinQueuedata structure that can st.pdf
Exercise 3-15-Design and implement aMinQueuedata structure that can st.pdf
 
Exercise 3 PYTHON Identify the most common words in the description of.pdf
Exercise 3 PYTHON Identify the most common words in the description of.pdfExercise 3 PYTHON Identify the most common words in the description of.pdf
Exercise 3 PYTHON Identify the most common words in the description of.pdf
 
Example 1- A recent study focused on the number of times men and women (1).pdf
Example 1- A recent study focused on the number of times men and women (1).pdfExample 1- A recent study focused on the number of times men and women (1).pdf
Example 1- A recent study focused on the number of times men and women (1).pdf
 
Examine the screenshot provided below- Check only the answers that are.pdf
Examine the screenshot provided below- Check only the answers that are.pdfExamine the screenshot provided below- Check only the answers that are.pdf
Examine the screenshot provided below- Check only the answers that are.pdf
 
Evidence that natural selection does not cause adaptation to match fut.pdf
Evidence that natural selection does not cause adaptation to match fut.pdfEvidence that natural selection does not cause adaptation to match fut.pdf
Evidence that natural selection does not cause adaptation to match fut.pdf
 
exactly 2 - Click on the icon to viens the binomial probabities table-.pdf
exactly 2 - Click on the icon to viens the binomial probabities table-.pdfexactly 2 - Click on the icon to viens the binomial probabities table-.pdf
exactly 2 - Click on the icon to viens the binomial probabities table-.pdf
 
Every year- natural disasters impact families- communities- nations- a.pdf
Every year- natural disasters impact families- communities- nations- a.pdfEvery year- natural disasters impact families- communities- nations- a.pdf
Every year- natural disasters impact families- communities- nations- a.pdf
 
Event A occurs with probability 0-055 - Event B occurs with probabilit.pdf
Event A occurs with probability 0-055 - Event B occurs with probabilit.pdfEvent A occurs with probability 0-055 - Event B occurs with probabilit.pdf
Event A occurs with probability 0-055 - Event B occurs with probabilit.pdf
 
Every process is identified by a process ID number (PID)- The very fir.pdf
Every process is identified by a process ID number (PID)- The very fir.pdfEvery process is identified by a process ID number (PID)- The very fir.pdf
Every process is identified by a process ID number (PID)- The very fir.pdf
 
Eve has intercepted a large cache of text that appears to be encrypted.pdf
Eve has intercepted a large cache of text that appears to be encrypted.pdfEve has intercepted a large cache of text that appears to be encrypted.pdf
Eve has intercepted a large cache of text that appears to be encrypted.pdf
 
Evaluate the significance of ROCE- Earnings per share and the overall.pdf
Evaluate the significance of ROCE- Earnings per share and the overall.pdfEvaluate the significance of ROCE- Earnings per share and the overall.pdf
Evaluate the significance of ROCE- Earnings per share and the overall.pdf
 
Even though Darwin came up with the theory of sexual selection over 15.pdf
Even though Darwin came up with the theory of sexual selection over 15.pdfEven though Darwin came up with the theory of sexual selection over 15.pdf
Even though Darwin came up with the theory of sexual selection over 15.pdf
 
Evaluate the relationship between population density and population di.pdf
Evaluate the relationship between population density and population di.pdfEvaluate the relationship between population density and population di.pdf
Evaluate the relationship between population density and population di.pdf
 
Estimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdf
Estimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdfEstimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdf
Estimated Annual Life Insurance Premium Rates per $1-000 of Face Value.pdf
 
Evaluate- n-11763n+2.pdf
Evaluate- n-11763n+2.pdfEvaluate- n-11763n+2.pdf
Evaluate- n-11763n+2.pdf
 
eternine whether the scathor diagram indicales that a linear relabion.pdf
eternine whether the scathor diagram indicales that a linear relabion.pdfeternine whether the scathor diagram indicales that a linear relabion.pdf
eternine whether the scathor diagram indicales that a linear relabion.pdf
 
estion li Question 3 If the probability distribution for the random va.pdf
estion li Question 3 If the probability distribution for the random va.pdfestion li Question 3 If the probability distribution for the random va.pdf
estion li Question 3 If the probability distribution for the random va.pdf
 

Recently uploaded

Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 

Recently uploaded (20)

Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 

Exercise 2- Implementing Geometry Formulas with functions (10 points) (1).pdf

  • 1. Exercise 2: Implementing Geometry Formulas with functions (10 points) Implement the following functions that return the volume and surface areas of 3D shapes: double cone_volume(double r , double h ) ; // r = radius, h = height double cone_surface(double r , double h ) ; // r = radius, h = height double cube_volume(double a); // a = edge double cube_surface(double a) ; // a = edge double sphere_volume(double r ) ; // r = radius double sphere_surface(double r ) ; // r = radius double cylinder_volume(double r , double h ) ; // r = radius, h = height double cylinder_surface(double r , double h ) ; // r = radius, h = height Write a program that prompts the user to enter whether they have a cone, cube, sphere, or cylinder. - If the user enters "cone", the program then prompts the user to enter two values: radius and height. The program then calls the respective functions to print the volume and surface area of the cone. - If the user enters "cube", the program then prompts the user to enter one value: edge length. The program then calls the respective functions to print the volume and surface area of the cube. - If the user enters "sphere", the program then prompts the user to enter one value: radius. The program then calls the respective functions to print the volume and surface area of the sphere. - If the user enters "cylinder", the program then prompts the user to enter two values: radius and height. The program then calls the respective functions to print the volume and surface area of a cylinder. - If the user enters anything other than cone, cube, sphere, or cylinder, print "Invalid shape."