455,603 views
31 votes
31 votes
Demonstrate how to write each condition as an if-else in Java. If yes, then the computer should print “The answer is A,” “The answer is B,” or “The answer is C.” Otherwise, the computer should print “The answer is not here.”

Condition: variable choice is A, B, or C.


(You must actually give a answer to the question. If your answer is A B or C then im removing your answer and flagging it.

User Tricksless
by
3.2k points

1 Answer

14 votes
14 votes


\tt x=(float(input(


\tt if\:x=A:


\qquad\tt print(


\tt elif\::


\tt x=B;


\qquad\tt print(


\tt x=C;


\qquad\tt print(


\tt else\::


\qquad\tt print(

User Yuantao
by
3.1k points