[Image]

Calculator

Inputs 2 numbers, then adds, subtracts, multiplies, divides, and calculates the power.


Important Commands

super("Calculator");
Run constructor of the parent class (Frame) and sets the title "Calculator".

double a = Double.parseDouble.... );
Converts a String to a double (decimal number).

double exp = Math.pow(a,b);
Calculate power a^b.


Comments

A "real" program would probably use a different button for each calculation.