CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: melissax

Search: Search took 0.03 seconds.

  1. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    laserlight thank you,
    I used as philip said but stil jumping to the volume result

    #include<iostream>
    #include<conio.h>
    #include<stdio.h>
    using namespace std;

    const float PI=3.14;
  2. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    I tried cin>>clear(); after cin>>r; cin>>h but it gives error.

    clear undecleared for first use of function.
    then i insert #include<stdio.h> library.

    How can i handle.
    Thank you.
  3. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    31463
    When i select option 1 there is no problem but when i enter double program sending volume value.
    31465
    Which part i have to make changes.


    cout<<"\nEnter radius of Cylinder\n";...
  4. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    I know we cant compare number types you are right. Accidentaly i wrote it.
  5. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    #include<iostream>
    #include<conio.h>
    using namespace std;

    const float PI=3.14;

    class calculate
    {
    public:
    void cylinder_area(int r,int h);
  6. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    Should i use if else for example if(r==float){
    }
    and which part of the codes i have to check.
  7. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    cout<<"\nEnter radius of Cylinder\n";
    cin>>r;
    cout<<"\nEnter height of Cylinder\n";
    cin>>h;
    switch(ch)
    {
    case 1:
    obj.cylinder_area(r,h);
    break;
    case 2:
  8. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    Thank you i did with your helps.

    I tested to the program when user input second choice with integer there is no problem.
    But in the second choice when user input for example 3.75 it is calculate...
  9. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    Hi again,
    Today, i made some changes as your advices. This is working but i know some mistakes. I wanted to make program automatic can understand number types. I am waiting your comments.

    ...
  10. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    I am right, your talking style so rude.
    And I am learning basics as doing applications with helpfull programmers.
    You dont want my learning.
    Anyway
  11. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    2kaud, i would like to thank you.
    With patience you teach me.
    Aim of this forum should be guidence.
    GCDEF you said "read from book" so you shouldnt give responce.
    Why you reply
    I understand,...
  12. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    #include<iostream>
    #include<conio.h>
    using namespace std;
    const float PI=3.14;

    class cylinder{
    double r, h;
    public:
    double area();
    double volume();
  13. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    #include<iostream>
    #include<conio.h>
    using namespace std;
    const float PI=3.14;

    class cylinder{
    double r, h;
    public:
    double area();
    double volume();
  14. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    2kaud i copied with Alt and # pasted it with nice style but when i send i saw that it doesnt change
  15. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    #include<iostream>
    using namespace std;
    const float PI=3.14;

    class cylinder{
    double r, h;
    // Volume of cylinder
    double volume(){
    return PI*r*r*h;
    }// Area of...
  16. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    #include<iostream>
    using namespace std;
    const float PI=3.14;

    class cylinder{
    double r, h;
    // Volume of cylinder
    double volume(){
    return PI*r*r*h;
    }// Area of...
  17. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    I will calculate area and volume of cylinder with respect to this rules:
    a)Radius and height will be input from keyboard.
    b)Radius and height can be real numbers,float or integer for that reason...
  18. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    "but what's the point of having functions like Volume have different return types anyway?

    you are right as my opinion this is not logical but question is so.
  19. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    I tried to use same function with different tasks like abc() functions. This is rule as i know.
    Can you show me which part i have to change.
  20. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    But like abs() function name will be same but using will be different. This is rule as i know.
  21. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    2kaud i come back i had middterms so i couldnt come.And i want to start subject again with my study.

    I have a question related with function overloading.

    I will calculate area and volume of...
  22. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    Ninja Thank you for answer,
    I think i couldnt explain question clearly;
    As a question;
    1. r and h have to input from keyboard but you gave value them and as double.
    2. r and h can input from...
  23. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    You are right should be with inheritance
    Actually,
    My teacher didnt teach inheritance yet.
    I think question can be without inheritance.
    What is your advise?
    Thank you.
  24. Replies
    67
    Views
    19,871

    Re: Area and volume of cylinder

    2kaud,

    First of all thank for respond.
    I know formula of them but i am trying to do polymorphism.
    For instance with a uniq calculate(); function i am trying to do tree options.
    But i dont know...
  25. Replies
    67
    Views
    19,871

    Area and volume of cylinder

    Hello friends,
    I would like to calculate area and volume of cylinder but radious and height should be integer, float and double. How can i do?
    May you help me?
Results 1 to 25 of 25





Click Here to Expand Forum to Full Width

Featured