Please help asap with an alignment of console.log output!
Guys, I have a code that generates a table, and I can't make it look good. The output should be in console.log only. Here is my code that works, but the output doesn't look as it supposed to(to test in in console just press Ctrl+Shift+i ): function displayWelcome() { console.log("Welcome! \nThis program will determine the time to pay off a credit card and the interest paid based on the current balance, the interest rate, and the monthly payments made.") } function calculateMinimumPayment(balance, minimumPayPercentage) { return Math.max(20, balance * minimumPayPercentage); } function displayPayments(balance, interest, minimumPay) { console.log("Your current balance is: $" + balance.toFixed(2)) console.log("Your interest rate is: " + (interest * 100) + "%") console.log("Your minimum payment is: $" + minimumPay) console.log("\nYear Balance Payment # Interest Paid") var year = 1; var interestPaid = 0; while (balance > 0) { interestPaid += balance * interest / 12; // principal paid should be calculated balance = Math.max(0, balance - (minimumPay - balance * interest / 12)); console.log(year + " " + balance.toFixed(2) + " " + interestPaid.toFixed(2)); year++; } } var currentBalance = 1500; var minimumPayPercentage = 0.02; var interest = 0.18; displayWelcome() var minimumPay = calculateMinimumPayment(currentBalance, minimumPayPercentage); displayPayments(currentBalance, interest, minimumPay);