OK, here is my dilemma. I have been using Visual C++ on Winblows (as required by my school, bleh) and have recently bought a Ti and Mac OS X. Since I purchased the "future of computing", I can't seem to find a way for Project Builder to compile and run my program. It worked fine under Visual Basic C++ and been doing all sorts of things to try to have it run under PB. I looked at this topic
http://forums.macnn.com/cgi-bin/Foru...ML/000706.html and tried to compile it under UNIX with success. However, I was wondering if someone out there could help me compile this program under PB. Here is the simple program:
//Kenneth Woo
//CIS 3100 Section KM14
//Programming Assignment 1
//Some Statistical Analysis
# include <iostream>
using namespace std;
# include <cmath>
using namespace std;
int main ()
{
float A, B, C, D, E, F, G, sum, mean, variance;
cout<<"I will give you the sum, mean, and ";
cout<<"standard deviation of any seven numbers. \n";
cout<<"Type each number, followed by the enter key. \n";
cout<<"1st number = ? \n";
cin>>A;
cout<<"2nd number = ? \n";
cin>>B;
cout<<"3rd number = ? \n";
cin>>C;
cout<<"4th number = ? \n";
cin>>D;
cout<<"5th number = ? \n";
cin>>E;
cout<<"6th number = ? \n";
cin>>F;
cout<<"7th number = ? \n";
cin>>G;
cout<<endl;
//Now for the Equations
sum = (A+B+C+D+E+F+G);
mean = (sum) / 7.0;
variance = ((A-mean)*(A-mean)+(B-mean)*(B-mean)+(C-mean)*(C-mean)+
(D-mean)*(D-mean)+(E-mean)*(E-mean)+(F-mean)*(F-mean)+
(G-mean)*(G-mean)) / 6.0;
//Now for the output
cout<<"The numbers you have typed in are " <<A<<", "<<B<<", ";
cout<<C<<", "<<D<<", "<<E<<", "<<F<<", and "<<G<<"." <<endl<<endl;
cout<<"The sum is " <<sum<<endl<&am p;lt;endl;
cout<<"The mean is " <<mean<<endl<&a mp;lt;endl;
cout<<"The variance is " <<variance<<endl&l t;<endl;
cout<<"The standard deviation is " <<sqrt(variance)<<endl <<endl;
return 0;
}
Would I need to obtain the iostream header file? How would I get it? How do I get PB to build correctly (this is the error I usually get). Thanks!
------------------
That's the power of this...and that's what Apple has really put into our hands. It's not about new technology, it's not about a new toy or a new box....It's a whole new way of thinking. - Jon Kamen, Proprietor@radical.media on the Powerbook G4