C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 27th, 2008, 08:06 PM
amakusa007 amakusa007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 4 amakusa007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 53 m 32 sec
Reputation Power: 0
Help with calculate area of a circle and volume of sphere that are of the same radius

need help on this homework assignment.

help with calculating area of a circle and volume of sphere that are of the same radius. Solution must use functions. I can only work with the areas that are highlighted in bold.

#include <iostream>
#include <cmath>

using namespace std;

const double PI = 3.14159;

double area (double radius); // function prototype
double volume (double radius);
void display (double radius, double areaValue, double volumeValue);

int main ()
{
double radius;
double area_of_circle;
double volume_of_sphere;

cout<<"Enter the radius";
cin >> radius;
area_of_circle = Write the function call ;
volume_of_sphere = Write the function call;
cout<< "Circle One \n";
display ( write parameters to pass to display);

cout << "\n\n";
cout<<"Enter the radius";
cin >> radius;
area_of_circle = Write the function call;
volume_of_sphere = Write the function call;
cout<< "Circle two \n";
display (write parameters to pass to display);

system ("PAUSE");
return 0;
}

/* Computes area of circle */
/* */
/* Inputs: */
/* radius */
/* */
/* Output: */
/* area */


double area (double radius)
{
return (PI * pow (radius, 2));
}

/* Computes volume of sphere */
/* */
/* Inputs: */
/* radius */
/* */
/* Output: */
/* Volume */

double volume (double radius)
{
return ((4.0/3.0) * PI * pow (radius, 3));
}

/* Display computations */
/* */
/* Inputs: */
/* radius, area, volume */
/* */
/* Output: */
/* none */

void display (double radius, double areaValue, double volumeValue)
{
cout << "Radius = " << radius << " inches \n";
cout << print ("radius");
cout << print ("volume");
}

Reply With Quote
  #2  
Old July 27th, 2008, 10:03 PM
darken4life darken4life is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 159 darken4life User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 45 m 10 sec
Reputation Power: 2
We all know you put absolutely no effort in this "assignment" when you are stuck on how to print a cout statement to prompt the user for the radius.

Reply With Quote
  #3  
Old July 27th, 2008, 10:10 PM
amakusa007 amakusa007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 4 amakusa007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 53 m 32 sec
Reputation Power: 0
Quote:
Originally Posted by darken4life
We all know you put absolutely no effort in this "assignment" when you are stuck on how to print a cout statement to prompt the user for the radius.


It's not that I don't put no effort is that I am not really that good in C++. I have understand some other areas in this program but don't know nothing for this one. I took a course a long time ago but I forgot to work with this. Now I need to understand this better cause basically all my upper levels classes will cover these areas & I need to know the basic concepts for these programs in C++

Reply With Quote
  #4  
Old July 27th, 2008, 10:13 PM
amakusa007 amakusa007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 4 amakusa007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 53 m 32 sec
Reputation Power: 0
darken4life or anyone

If someone can explain this exercise to me step by step, I would gladly appreciated.

Reply With Quote
  #5  
Old July 28th, 2008, 07:18 AM
MaHuJa MaHuJa is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Dec 2007
Posts: 536 MaHuJa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 Days 7 h 35 m 48 sec
Reputation Power: 2
Send a message via Skype to MaHuJa Send a message via XFire to MaHuJa
This is the sort of thing found in early tutorials on C++.
Sorry, there's little excuse for this one - go look up how to call a function.

Reply With Quote
  #6  
Old July 28th, 2008, 08:15 AM
amakusa007 amakusa007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 4 amakusa007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 53 m 32 sec
Reputation Power: 0
Quote:
Originally Posted by MaHuJa
This is the sort of thing found in early tutorials on C++.
Sorry, there's little excuse for this one - go look up how to call a function.


where can I look it up? I don't want someone to do the exercise for me, what I want is to learn how to do this exercise correctly. I have very little knowledge in C++ . I have learned how to do the grade exercise & some calculations but no like this one. If someone can point me to the right direction on were to learn this I might be able to work on this assignment for a bit.

Reply With Quote
  #7  
Old July 28th, 2008, 10:24 AM
darken4life darken4life is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 159 darken4life User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 45 m 10 sec
Reputation Power: 2
You can easily google anything up.
http://www.cplusplus.com/doc/tutorial/

Reply With Quote
  #8  
Old July 28th, 2008, 03:08 PM
erc1979 erc1979 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 3 erc1979 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 50 sec
Reputation Power: 0
Amen Brutha,

Why don't you read more and figure this out for yourself. You will feel a sense of pride.

2 cents

Goto google and type:

c++ tutorial || help with c++

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Help with calculate area of a circle and volume of sphere that are of the same radius


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT