Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Harry Hunter   on Apr 15 In Java Category.

  
Question Answered By: Amir Shaikh   on Apr 15

It looks like you have the operands out of order.

Change "=+" to "+=" and it should owrk just fine.

Your code:

double myNumber = 0;

if (myNumber < .15){
myNumber =+ .0001;
}else{
myNumber = .04;
}

Should read:
double myNumber = 0;

if (myNumber < .15){
myNumber += .0001;
}else{
myNumber = .04;
}

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on New to JAVA and Frustrated with the math Or get search suggestion and latest updates.


Tagged: