This site requires JavaScript, please enable it in your browser!
Greenfoot back
Darkmauro
Darkmauro wrote ...

2017/11/28

Something bad with this code?(Math.cos)

Darkmauro Darkmauro

2017/11/28

#
Hi, anyone can tell me what's wrong with this code, I want to calculate the cos of a number but the code don't compile, can anyone help me?
int d,e;
public void act()
{
e=60;
 c=(int)(41*Math.cos(Math.toRadians(e)));
}
danpost danpost

2017/11/29

#
I do not see where 'c' is declared as a variable. Also, I do not see where 'd' is used anywhere (although it might be used elsewhere).
You need to login to post a reply.