Java (beginner): creating a menu that displays features of a calculator -
i started java class during associates software engineer track , having difficulty understanding language.
i need create menu displays features of calculator, output should display console this:
what do?
a.) add 2 numbers.
b.) subtract 2 numbers.
c.) multiply 2 numbers.
d.) divide 2 numbers.please enter letter.
then need choice(input) user, grab 2 numbers(input) user.
i don't know begin. started class , we're diving head first.
any & appreciated!
you can use scanner class.
for example:
java.util.scanner in = new java.util.scanner(system.in); string input = in.nextline(); switch (input.tolowercase()) { case "a": system.out.println("option \"a\" selected;"); break; case "b": system.out.println("option \"b\" selected;"); break;
Comments
Post a Comment