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.

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

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;
    }

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

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

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

commented: Nice! +15

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

commented: ? -2

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

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

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

@shahzrinsaid, well... here have you and your friend read these:
https://answers.yahoo.com/question/index?qid=20111201192111AAyHYQr
http://www.cplusplus.com/forum/beginner/85642/
http://cplusplus-in.blogspot.com/2012/06/how-to-determine-volume-of-cylinder.html
http://www.cplusplus.com/forum/beginner/52102/
http://www.assignmentexpert.com/free-answers/question-on-programming-c-plus-plus-23079.html
http://projectxplod.blogspot.com/2012/06/c-program-to-compute-surface-area-of.html
http://www.cquestions.com/2011/07/write-c-program-to-find-volume-and_1823.html

I want you to know this and for future reference... a lot of these simple homework questions have been answered in the past and have been placed on certain sites. You should try google before asking... you should only ask if you have a hard time with a certain problem but only if you have tried and made an effort.

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

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 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.