java - Using if else statements with User inputs -


the if else statement won't work i've tried .equal ("1") doesn't work either

double totalnum = numone + numtwo;      system.out.println("enter 1 add or 2 multiply number ");    double equationtype = input.nextdouble();     if (equationtype == 1)){        total = totalnum + 3.75;   } else {        total = totalnum * 1.25;    } system.out.prinln(total); 

use of undeclared variable. (totalnum has capital n).

totalnum not totalnum in if-else


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -