From add3c8efac36ca662d8bfab7dcb095ca86ea4d2b Mon Sep 17 00:00:00 2001 From: Anthony Branze Date: Tue, 16 May 2017 10:10:42 -0700 Subject: [PATCH] Update Chapter1Practice.js Want to build out a function that dioes it all in one line basically. I am not going to put serious sustained effort into this because of how It does not do much in terms of scaling or purpose of program, But I will Throw in additional lines of code when I learn more. Maybe one day even write this into one line of code itself. --- Chapter1Practice.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Chapter1Practice.js b/Chapter1Practice.js index 38d363e..9aba599 100644 --- a/Chapter1Practice.js +++ b/Chapter1Practice.js @@ -50,7 +50,16 @@ while (accountBalance > SPENDING_LIMIT) { -/* Writing function to optimize code. +/* Write function to optimize code. function buyProduct(){ - while (accountBalance !> SPENDING_LIMIT){ + while (accountBalance > SPENDING_LIMIT) &&|| (accountBalance > tempSaleAmount){ + Set sale price; + set sale price + accesory price; + set sale price After Tax; + display balance owed; + buy items() ? + subtract sales + Tax from account; + display account balance after purchase; + + } */