C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 2nd, 2012, 06:19 PM
ForTomorrow ForTomorrow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 1 ForTomorrow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 33 sec
Reputation Power: 0
An algorithm for an IPO chart

Hi everyone,

I am new to the forum. I would like to know if someone can offer me some assistance. I am currently taking a beginners programming class and I want to know if someone can help me to write an algorithm for an IPO chart.

I am supposed to write an algorithm for a program that calculates and displays the volume of a rectangular box. Can someone help?

Thanks.

Reply With Quote
  #2  
Old September 2nd, 2012, 07:22 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,458 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 6 h 26 m 43 sec
Reputation Power: 403
Here is an example program for the geometrical problem. I don't know anything about money so I can't help you with the IPO chart.
Code:

#include<stdio.h>
#include<math.h>

void display_sphere(double radius,double volume) {
  int c;
  puts("       -------");
  puts("    --/       \\--");
  puts("   /             \\");
  puts("  /               \\");
  puts("  |               |");
  puts("  \\               /");
  puts("   \\             /");
  puts("    --\\       /--");
  puts("       -------");
  puts("");
  printf("Volume is %g cubic lengths\n",volume);
  puts("Use the arrow keys or mouse to rotate the sphere about any axis.");
  puts("Press enter to terminate.");
  while ((EOF != (c = getchar())) && ('\n' != c))
    ;
}

#define TAU (2*M_PI)  /* http://www.youtube.com/watch?v=jG7vhMMXagQ */

double compute_sphere_volume(double radius) {
  /* Skip the triple integral and use the formula */
  return (2*TAU/3)*radius*radius*radius;
}

int main() {
  double radius;
  char buffer[30];
  puts("Enter sphere radius:");
  fgets(buffer,26,stdin);
  sscanf(buffer,"%lf ",&radius);
  display_sphere(radius,compute_sphere_volume(radius));
  return 0;
}
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > An algorithm for an IPO chart

Developer Shed Advertisers and Affiliates



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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap