Write C++ Function Named Surfarea() That Accepts a Cylinder Radius

Member Avatar

Write a complete program that have two functions named CylinderVolume() and CylinderArea(). Both functions should receive diameter and height of cylinder as parameters. Each function should return the volume and area respectively to main program. Given formula:
Cylinder volume, v=πr2h
Cylinder area, a=2π2r+2πrh
where π is pi, r is radius and h is height.

  • 6 Contributors
  • forum 12 Replies
  • 4,193 Views
  • 1 Day Discussion Span
  • comment Latest Post Latest Post by <M/>

Recommended Answers

@shahzrinsaid: What have you tried? What problems have you encountered? There is plenty of information there to make an honest attempt at the assignment - you have the formulae; all you need to do is construct functions that implement them.

@Sarkurd: It is obvious this is some sort of assignment …

Jump to Post

Well i know i was wrong but i just wanted to give him a hint.

Jump to Post

No point of helping someone who has never tried...

Jump to Post

All 12 Replies

Member Avatar

Member Avatar

i wrote the CylinderVolume() for you so you can have an idea to write the other function

                                                      #include <iostream>      using namespace std;      const double pi= 3.14159;      double CylinderVolume(double diameter, double height){         double radius = diameter/2.0;         return pi * radius * radius * height;     }      int main(){      cin.ignore();     cin.get();     return 0;     }                                                  

Member Avatar

@shahzrinsaid: What have you tried? What problems have you encountered? There is plenty of information there to make an honest attempt at the assignment - you have the formulae; all you need to do is construct functions that implement them.

@Sarkurd: It is obvious this is some sort of assignment and nobody benefits from giving out answers. The OP learns nothing about the assignment or its goals; the OP is less prepared to tackle later material; and the community is burdened by having to deal with the propagated request for free answers.

Edited by L7Sqr

Member Avatar

Well i know i was wrong but i just wanted to give him a hint.

Member Avatar

No point of helping someone who has never tried...

Member Avatar

write a c++ program to library management system that must can minimumly update,delete,add,search information.

Member Avatar

@BERIHUN, Go make your own thread and ask him...

Member Avatar

@shahzrinsaid, Have you tried to write any codes to date?

Member Avatar

@Sarkurd thanks for the help. sorry to all I just want to help my friend only.

Member Avatar

Member Avatar

ok thanks for your advice. and thanks for the reference's possible that you have given to me. I apologize for my mistake.

Member Avatar

I apologize for my mistake.

It's okay.

thanks for the reference's possible that you have given to me.

Have you managed to solve your problem yet? Or do you still need help? If not, please mark the question solved and consider giving those that helped you upvotes + comments :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.

Write C++ Function Named Surfarea() That Accepts a Cylinder Radius

Source: https://www.daniweb.com/programming/software-development/threads/479755/calculate-the-volume-and-area-of-cylinder

0 Response to "Write C++ Function Named Surfarea() That Accepts a Cylinder Radius"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel