Need Help with HW

I got this homework in my computer science class I can't seem to get it can someone give me an idea how this will look please!
"Write a C++ program to display a table of values for angle α (in degrees) and
side C of the triangle shown below. A is given as 10, and B is given as 20. The length of side C can be calculated using
the law of cosines as shown below formulation. Use a for loop to calculate C as angle α varies from 0 to 90 degrees in 5
degree increments. The output should be a table of values for A, B, C, and α."
Start by breaking the problem down.

You have a triangle with two fixed sides A and B and a degree 0 - 90 in increments of 5.

You have to solve for C using the cosine formula.

Then put that all in a for loop that outputs the answer to the console.

1
2
3
for (int i = 0; i <= 90; i += 5){
     //Code here.
}
Ok i had that but when you solve for c do u do that before the loop and also can u explain a little how to display it with setw() please
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
	int A = 10;
	int B = 20;
	long double degree;
	double c=0;
	cout << " A   B  C  Degree " <<endl;
	cout << " -----------------" <<endl;

	for( degree=0; degree <= 90; degree += 5);
	{
		
		degree= cos(degree);
		int c=0;
		c= pow(A,2.0) * pow(B,2.0) - 2*(A)*(B)*(degree);
		cout << setw(4) << A << setw(4) << B << setw(7) << degree << setw(7) << c << endl;
	}
}


this is what i have i know its wrong but can u help whats wrong
Topic archived. No new replies allowed.