Help me to fix this plz.... Function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
28th Mar 2021, 7:40 PM
Abdul Ahad
Abdul Ahad - avatar
2 Answers
+ 3
Abdul Ahad There are lots of mistakes in your code 1 - there is else if (condition) in java not if else {} 2 - single equal (=) used for assignment not for comparison, double equal (==) used for comparison 3 - There should be curly braces after condition if there is multiline statements inside condition 4 - you have written obj. input(p) but there is no parameter in method input() 5 - you have declared taxincome in method input () so it would be local variable and you can't access local variable in other methods. 6 - Class name should start with capital letters. 7 - You made calc method but didn't call Here is correct solution: https://code.sololearn.com/ch2mCDwRTgWy/?ref=app
28th Mar 2021, 8:11 PM
A͢J
A͢J - avatar
0
Abdul Ahad For multiline statements there should be curly braces in Java. if(condition) { //Statement 1 //Statement 2 } After that also not working.
28th Mar 2021, 7:50 PM
Abdul Ahad
Abdul Ahad - avatar