I was unable to find an ATA (Amazon Technical Academy) community forum on here. So posting my question here.
As part of a lab exercise on conditionals, the instructions require entering the following 2 lines of code between the // characters. The method simpleConditional accepts an int type and returns a simple message stored in a String variable called answer.
In order to advance in the exercise, each step must successfully be built/compiled and run. However I keep getting build errors on something as simple as this???
What seemed so incredibly simple has become a nightmare to decipher. The compiler keeps indicating of the 3 tasks, 2 executed, 1 up to date. The only help is this forum. My code is below:
public class ConditionalStatements {
/**
* This method is used for problem one in the README.
* @param price A price that will be passed in by the test.
* @return String A string used to validate the test.
*/
public String simpleConditional(int price) {
String answer = null;
// TODO: Write Step 1 code between the forward slashes
if(price<20) {
answer = "Buyng new shirt";
}
//
return answer;
}
}
Any feedback would be greatly appreciated!