thanks for the help, got that working. Only problem is one variable is random while the other pretty much stays constant at .09. The code for the two are EXACTLY the same, yet one stays at a small number and the other one is random. why might that be?
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <iomanip>
bool isTri(double,double,double);
int main()
{
srand((unsigned)time(NULL));
double a,b,c,point1,point2;
point2 = static_cast<double>(rand()) / RAND_MAX;
point1 = static_cast<double>(rand()) / RAND_MAX;
a = point1;
b = point2;
c = 100 - (point1+point2);
std::cout.precision(2);
std::cout.setf(std::ios_base::fixed, std::ios_base::floatfield);
std::cout.setf(std::ios_base::showpoint);
std::cout << "here are the two rands: " << point1 << " " << point2;
}
bool isTri(double a,double b,double c)
{
}
my output upon running multiple times:
here are the two rands: .55 .13
here are the two rands: .30 .13
here are the two rands: .92 .13
here are the two rands: .11 .13
i ran the program a lot more times and still turned out with .13
what i noticed*** this only happens to the first number, the second is fine, switching the order of the two variables will also switch which one keeps getting a near constant number.