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?
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