zobiejrz / dadschool2015

The CSC135 coursework from UNLV done in Node.JS.
0 stars 0 forks source link

Code will run with string and negative numbers #1

Closed zobiejrz closed 9 years ago

zobiejrz commented 9 years ago

The code will accept negative numbers and string for the 'kwhrs' variable. I end up with things like, The bill for -1 KWHRS: Cost of Electricity used: -0.61 County surcharge: -9.5 City utility tax: -3.25

If strings are the input however, I get, The bill for zero KWHRS: Cost of Electricity used: NaN County surcharge: NaN City utility tax: NaN

zobiejrz commented 9 years ago

Resolved (ish) with converting to node.js (#2): Code will no longer run negative numbers and string, but will instead input them, and infinitely loop nothing.