# CS homework help? (Java)

#### LuDaCriS66

##### Platinum Member
I just need to make a pie chart basically.. and by using the
"Arc2D.Double" method..

let's say the first slice in the Pie Chart is 50%.. which means the starting angle and ending angle can be 0 and 180 right.. how do I make it so that the next piece has the right coordinates to start off where the last piece left off? Meaning.. so that the pieces are connected to each other..

bump

#### ScottyB

##### Diamond Member
just make a variable to add to the beginning and to end corrdintents each time, sort of like counters.

so:

Then if you have your first pie as 175;

begCoor = 0 + varAdd ;
endCoor = 175+ varAdd;

Then if your next pie is 64;

begCoor = 0 + varAdd ;
endCoor = 64 + varAdd;

#### LuDaCriS66

##### Platinum Member
sweet.. thanks. I figured I should use some kind of "counter" variable but wasn't quite sure how..

now I wonder if my prof's gonna want us to add the inquiry methods for those variables

#### lukatmyshu

##### Senior member
Well normally you don't have to generate get and set methods for variables that don't need them .... but here I can kind of imagine them wanting one. WEll maybe not set, but definitely get (so that you can get the current angle offset ...)

#### LuDaCriS66

##### Platinum Member
Originally posted by: lukatmyshu
Well normally you don't have to generate get and set methods for variables that don't need them .... but here I can kind of imagine them wanting one. WEll maybe not set, but definitely get (so that you can get the current angle offset ...)

Yeah.. its just that our prof has told us to put in the inquiry methods on each assignment.... but this being a graphics assignment, I wasn't sure.. but I guess I might as well.. better not lose any marks for it