SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
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."

Más contenido relacionado

Similar a 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.pdfROWELL MARQUINA
 
Business App Programming Course Project
Business App Programming Course ProjectBusiness App Programming Course Project
Business App Programming Course ProjectCarmen 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 manipolationgraphitech
 
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.pdfhullibergerr25980
 
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 prasadShubham Prasad
 

Similar a 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
 

Más de 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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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).pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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-.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
Evaluate- n-11763n+2.pdf
Evaluate- n-11763n+2.pdfEvaluate- n-11763n+2.pdf
Evaluate- n-11763n+2.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 
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.pdfkarimshaikh24
 

Más de 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
 

Último

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 

Último (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

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."