Job sequencing problem trying to write own solution

f you try to to know gfg job sequencing problem it is written over there Maximum profit we can get when i m trying to store the profits in a new variable int error is coming that profit is of type of class i made and variable used for string sum of prfit is of type int

so algorithm which is used is sort jobs according to profit and then place them according to deadline last available
but not able to store the sum of profits of jobs done because I am storing it in a variable of type int but my profit is of type class which is made can you help have I uderstood my problem