Quad. Equation Solver Involving functions and constants Error

I am writing this Quadratic Equation Solver for school. As I write my output section the cout and cin get red-lined by Microsoft visual 2010 Express. The final getch and return statements are also red-lined. I do not know what I have done wrong to cause them to error out. If you could help me I would be very appreciated. ~Beverly

Just some quick program specifics: Must contain two string constants (Quadratic Function, and a border), also to use at least 2 value returning functions for all calculations.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Program Purpuse: To solve a quadratic equation using floating point
				 solutions and discriminents that are not negative.
*/

#include <iostream>						//Input Output (cout and cin)
#include <cmath>						//Computes common math (sqrt and pow)
#include <string>						//Programmer defined data type
#include <conio.h>						//Console Input Output

using namespace std;

//Below are functions to compute the neg. and pos. results from the quadratic formula
double FindPos(double a, double b, double c)
	//Preconditions: The value of the plus quadratic formula is known.
	//Postconditions: The formula is calculated and returned.
{
	double PosX;
	PosX = ((-b) + sqrt((pow(b,2)) - (4*a*c))) / (2*a);
	return PosX;
}

double FindNeg(double a, double b, double c)
	//Preconditions: The value of the minus quadratic formula is known.
	//Postconditions:The formula is calculated and returned
{
	double NegX;
	NegX = ((-b) - sqrt((pow(b,2)) - (4*a*c))) / (2*a);
	return NegX;
}
	
	//Below are string constants for name and border.
const string QUADFORM = "Quadratic Formula";
const string BORDER = ("%%%%%%%%%%%%%%%%%")

int main()
{
	//Declaration Section
	double a;
	double b;
	double c;
	double PosX;
	double NegX;

	//Input Section
	cout << "Enter the value for a: " << endl;
	cin >> a;
	cout << "Enter the value for b: " << endl;
	cin >> b;
	cout << "Enter the value for c: " << endl;
	cin >> c;

	//Processing Section
	PosX = FindPos(a,b,c);
	NegX = FindNeg(a,b,c);

	//Output Section
	cout << BORDER << BORDER << BORDER << BORDER << BORDER << endl;
	cout << "" << endl;
	cout << QUADFORM << endl;
	cout << "" << endl;
	cout << "a= " << a << "b= " << b << "c= " << c << endl;
	cout << "When adding the discriminant x= " << PosX << endl;
	cout << "When subtracting discriminant x= " << NegX << endl;
	cout << BORDER << BORDER << BORDER << BORDER << BORDER << endl;


	getch();
	return 0;
}
Oh just an FYI the top comment is cut off. Didn't want to put all my private info here :)
So after taking a break to get the kids I read over my code and fine the mistake. lol if you find it ;)
Topic archived. No new replies allowed.