Skip to content

Commit 5717b57

Browse files
committed
account Balance after purchase simple logic
1 parent 3c1d6c3 commit 5717b57

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

buyaccoutbalance.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//Simple App showing Account Balance after Purchase
2+
3+
var accountBalance = 500;
4+
var shoe = 700;
5+
var coupon = 900;
6+
7+
if (accountBalance >= shoe){
8+
accountBalance -= shoe;
9+
console.log("Purchase was sucessful and your account balance is: " + accountBalance);
10+
}
11+
else if (shoe - coupon <= accountBalance){
12+
accountBalance -= shoe - coupon;
13+
console.log("We just bought an amazing shoe using a COUPON");
14+
console.log("Our Account Balance is " + accountBalance);
15+
} else {
16+
console.log("You aint got enough geez bra!");
17+
}

0 commit comments

Comments
 (0)