Artha
12-27-2004, 09:02 PM
So I'm finally doing my science project, I'm wondering before I get too involved if this looks about right.
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int sel;
double kinener(int mass, int volume)
int main()
{
void menu();
return 0;
}
void menu(int sel)
{
cout <<"Formula List."<<endl;
cout <<"----"<<endl;
cout <<"1. Kinetic Energy."<</t<<"2. Speed"<</t<<"3. Average Acceleration."<<endl;
cout <<"4. Force of a Moving Object."<</t<<"5. Vector Resultant."<</t"<<"6. Specific Heat."<<endl;
cout <<"7. Pressure."<</t<<"8. Density"<</t<<"9. Mass."<<endl;
cout <<"10. Volume."<</t<<"11. Electrical Charge."<</t<<"12. Electrical Power."<<endl;
cout <<"13. Potential Difference."<</t<<"14. Percent Error."<</t<<endl;
cout <<"----"<<endl;
cout <<"Please input the number of the formula you wish to solve: ";
cin >>sel;
cout <<endl;
If (sel=1);
{
cout <<"Mass: ";
cin >>mass;
cout <<endl;
cout <<"Velocity: ";
cin >>velocity;
cout <<endl;
double kinener(x, y);
}
If (sel=2);
{
cout <<"Distance: ";
cin >>dist;
cout <<endl;
cout <<"Time: ";
cin >>time;
cout <<endl;
}
That last If block isn't done yet and there're going to be about 11 more. Thing is, I haven't learned how to do Ifs in class yet and the MSDN isn't super helpful. So if one of you uber programmers could provide guidance, I'd appreciate it.
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int sel;
double kinener(int mass, int volume)
int main()
{
void menu();
return 0;
}
void menu(int sel)
{
cout <<"Formula List."<<endl;
cout <<"----"<<endl;
cout <<"1. Kinetic Energy."<</t<<"2. Speed"<</t<<"3. Average Acceleration."<<endl;
cout <<"4. Force of a Moving Object."<</t<<"5. Vector Resultant."<</t"<<"6. Specific Heat."<<endl;
cout <<"7. Pressure."<</t<<"8. Density"<</t<<"9. Mass."<<endl;
cout <<"10. Volume."<</t<<"11. Electrical Charge."<</t<<"12. Electrical Power."<<endl;
cout <<"13. Potential Difference."<</t<<"14. Percent Error."<</t<<endl;
cout <<"----"<<endl;
cout <<"Please input the number of the formula you wish to solve: ";
cin >>sel;
cout <<endl;
If (sel=1);
{
cout <<"Mass: ";
cin >>mass;
cout <<endl;
cout <<"Velocity: ";
cin >>velocity;
cout <<endl;
double kinener(x, y);
}
If (sel=2);
{
cout <<"Distance: ";
cin >>dist;
cout <<endl;
cout <<"Time: ";
cin >>time;
cout <<endl;
}
That last If block isn't done yet and there're going to be about 11 more. Thing is, I haven't learned how to do Ifs in class yet and the MSDN isn't super helpful. So if one of you uber programmers could provide guidance, I'd appreciate it.