Coding help needed!
var originalCost = "itemCost";
var newPrice;
var discount = "discount";
onEvent("startBtn", "click", function( ) {
Ā Ā setScreen("calculator");
});
onEvent("itemCost","click", function() {Ā
Ā Ā getNumber;
});
onEvent("continue","click", function() {
Ā Ā setScreen("calculate2");
});
onEvent("calculate","click", function() {
Ā Ā setScreen("price");
Ā Ā calculate();
Ā Ā setText("finalPrice", newPrice);
});
onEvent("resetBtn","click", function(){
Ā Ā reset();
});
/// something isnt working here, I keep getting NaN "not a number as my result when i calculate"
function calculate() {
Ā percentage();
Ā newPrice = originalCost - (originalCost * discount);
}
function percentage() {
Ā Ā discount = discount/100;
}
function reset() {
Ā Ā onEvent("resetBtn","click",function() {
Ā Ā Ā Ā setScreen("calculator");
Ā Ā });
}
I am working on an app for my AP Computer Science Principles Create Portion, and I cannot get the app to run without the end result number showing as NaN, which I assume meansĀ āNot a Numberā. If anybody could help that would be amazing.Ā












