Not understanding how to write algorithms correctly | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Not understanding how to write algorithms correctly

I have gone through the overview and basic of javascript. Yet for some reason I am having an issues when I try to write a simple algorithm. Not sure what isn't clicking for me.

29th Apr 2017, 12:27 AM
Brandon Keith McFadden
Brandon Keith McFadden - avatar
1 Answer
0
For instance I'm trying to write code for an algorithm that multiplies price of any given item, quantity of any given item, and the sales price. Where 'price' and 'quantity' are my two undefined variables. My 'salesTax' variable I want to be .10. I want to use these to find my 'totalPrice' variable. I have written this several ways and it isn't coming out right?
29th Apr 2017, 12:32 AM
Brandon Keith McFadden
Brandon Keith McFadden - avatar