- Jul 14, 2005
- 988
- 0
- 76
Sorry I hit enter too early anyways
I wan't to make sure im going the right way with this project. Be aware that this is pretty much my first programming project except for hello world.
Most of the stuff i was doing was just learning without writing so any help and just a little bashing are needed.
#include <iostream>
#include <cmath>
using namespace std;
void display_greeting();
void get_sides();
void calc_area();
int main()
{
double sideA, sideB, sideC, area;
char ans;
cout<<"Hello. This program will ask you for three sides of a triangle, and will report in
formation about that triangle./n";
do{
get_sides();
calc_area();
void get_sides();
cout<<"Enter the three sides of the triangle: \n";
cin>>double sideA>>double sideB>>double sideC>>endl;
if(sideA+sideB<sideC&&sideA+sideC<sideB&&sideB+sideC<sideA);
}
else{
cout<<"Invalid triangle. Try again.\n";
}}
void calc_area();
float(sideA+sideB+sideC)
cout <<"Try again? [y|n]: ";
cin >> ans;
}}while (ans == 'y' || ans == 'Y';
return 0;
}
I wan't to make sure im going the right way with this project. Be aware that this is pretty much my first programming project except for hello world.
Most of the stuff i was doing was just learning without writing so any help and just a little bashing are needed.
#include <iostream>
#include <cmath>
using namespace std;
void display_greeting();
void get_sides();
void calc_area();
int main()
{
double sideA, sideB, sideC, area;
char ans;
cout<<"Hello. This program will ask you for three sides of a triangle, and will report in
formation about that triangle./n";
do{
get_sides();
calc_area();
void get_sides();
cout<<"Enter the three sides of the triangle: \n";
cin>>double sideA>>double sideB>>double sideC>>endl;
if(sideA+sideB<sideC&&sideA+sideC<sideB&&sideB+sideC<sideA);
}
else{
cout<<"Invalid triangle. Try again.\n";
}}
void calc_area();
float(sideA+sideB+sideC)
cout <<"Try again? [y|n]: ";
cin >> ans;
}}while (ans == 'y' || ans == 'Y';
return 0;
}
