amount = prompt("Please choose your price: ");
bank_balance = prompt("Please input your bank balance: ");
if (amount < bank_balance)
{
alert("You can buy this phone!");
result = confirm("Do you want to buy this phone?");
if (result==true)
alert("You bought it!");
else
alert("You canceled this trade!");
}
else
{
alert("Your balance isn't enough");
result = confirm("Do you want to canceled this trade?");
if (result==true)
alert("Canceled!");
else
alert("Continue trade!");
}
Mọi người cho em hỏi với code trên khi em nhập vào biến amount giá trị 100 và balance giá trị 50 thì chương trình ko chạy phần Else trong khi em nhập vào amount 400 và balance 300 thì chương trình vẫn chạy phần else bình thường. Em xin cảm ơn ạ
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?