C++ Beginner - Please Help

Ok, here goes...

I have recently started a c++ programming course and thought i was doing ok, then looked at the assignment for week 1...stuck to say the least.

I have to create a class cube with one instance variable length containing methods to calculate the area of the base of the cube, the total surface area of the cube, the volume of the cube, the length of the body diagonal of the cube and the angle the body diagonal makes with the base of the cube.

I have the skeleton of the class (detailed below) but past that feel like im just starting at a brick wall and wondering if anyone out there is able to help at all?

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
 #include <iostream>
	using namespace std;

	class cube
	{
	private:
		double length;
	public:
		cube( double length_value )
		{
			//CODE GOES HERE
		}
		double base_area()
		{
			//CODE GOES HERE
		}
		double total_surface_area()
		{
			//CODE GOES HERE
		}
		double volume()
		{
			//CODE GOES HERE
		}
		double length_of_face_diagonal()
		{
			//CODE GOES HERE
		}
		double length_of_body_diagonal()
		{
			//CODE GOES HERE
		}
		double angle_between_body_diagonal_and_base()
		{
			//CODE GOES HERE
		}

	}


As mentioned im at a blank for what i need to do next and really hoping someone can set me of in the right direction?

Please Please Please help me....many thanks in advance
We don't do the homework however here are some clues about what each method should do
the constructor should assign the variable length to its value
the base area is calculated by squaring the length
the total surface area is number of faces(8)*base area
the volume is the cube of the length
the length of body diagonal is (from the pythagorean theorem) the square root of (3*square of a)
as for the angle as I know its always 45° so I don't know what is this
that was the clues try to write it and we will correct it
Don't forget to append a semicolon to the end of your class.
Topic archived. No new replies allowed.