Search:
Type: Posts; User: melissax
Search:
Search took 0.01 seconds.

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;

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.

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

I know we cant compare number types you are right. Accidentaly i wrote it.

#include<iostream>
#include<conio.h>
using namespace std;
const float PI=3.14;
class calculate
{
public:
void cylinder_area(int r,int h);

Should i use if else for example if(r==float){
}
and which part of the codes i have to check.

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:

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

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

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

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

#include<iostream>
#include<conio.h>
using namespace std;
const float PI=3.14;
class cylinder{
double r, h;
public:
double area();
double volume();

#include<iostream>
#include<conio.h>
using namespace std;
const float PI=3.14;
class cylinder{
double r, h;
public:
double area();
double volume();

2kaud i copied with Alt and # pasted it with nice style but when i send i saw that it doesnt change

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

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

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

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

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.

But like abs() function name will be same but using will be different. This is rule as i know.

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

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

April 27th, 2013, 08:56 AM
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.

April 27th, 2013, 08:17 AM
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...

April 27th, 2013, 08:00 AM
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?

Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.
Featured
