# Thread: Math problems, I think...

1. ## Math problems, I think...

Hey,

Stupidity has brought me here again.

Can anyone tell me why I just get a bunch of 'non-lvalue' s on this?

Code:
```#include <iostream>

using namespace std;

class CalculateCube
{
public:
CalculateCube();
~CalculateCube();
void CalculatePointsFromValues(int centerX, int centerY, int size);
int CenterPointGivenX;
int CenterPointGivenY;
int SizeGiven;
int PointOneX;
int PointOneY;
int PointTwoX;
int PointTwoY;
int PointThreeX;
int PointThreeY;
int PointFourX;
int PointFourY;
int PointFiveX;
int PointFiveY;
int PointSixX;
int PointSixY;
int PointSevenX;
int PointSevenY;
int PointEightX;
int PointEightY;
protected:
int HalfSizeGiven;
};

CalculateCube::CalculateCube()
{

}

CalculateCube::~CalculateCube()
{

}

void CalculateCube::CalculatePointsFromValues(int centerX, int centerY, int size)
{
CenterPointGivenX = centerX;
CenterPointGivenY = centerY;
SizeGiven = size;

SizeGiven / 2 = HalfSizeGiven;

CenterPointGivenX + HalfSizeGiven = PointOneX;
CenterPointGivenX + HalfSizeGiven = PointTwoX;
CenterPointGivenX + HalfSizeGiven = PointThreeX;
CenterPointGivenX + HalfSizeGiven = PointFourX;

CenterPointGivenX - HalfSizeGiven = PointFiveX;
CenterPointGivenX - HalfSizeGiven = PointSixX;
CenterPointGivenX - HalfSizeGiven = PointSevenX;
CenterPointGivenX - HalfSizeGiven = PointEightX;

CenterPointGivenY + HalfSizeGiven = PointOneY;
CenterPointGivenY + HalfSizeGiven = PointTwoY;
CenterPointGivenY + HalfSizeGiven = PointFiveY;
CenterPointGivenY + HalfSizeGiven = PointSixY;

CenterPointGivenY - HalfSizeGiven = PointThreeY;
CenterPointGivenY - HalfSizeGiven = PointFourY;
CenterPointGivenY - HalfSizeGiven = PointSevenY;
CenterPointGivenY - HalfSizeGiven = PointEightY;
}```
Thanks!
FlyingIsFun1217

2. You've got all of your assignments backwards...

Code:
```int a = 5, b = 6, c = 7;
...
a = b + c; /* Right! */
b + c = a; /* WRONG WRONG WRONG */
...```

3. The last 17 equations of your code don't have valid lvalues (i.e., the expression on the left that you're trying to assign to, can't be).

4. Ok, didn't realize it had to be in that order
Thanks for helping me

FlyingIsFun1217