alert(`Hello
World!`);
alert(`Hello\nWorld!`);
И код я бы реализовал так:
let ammountOfMoney = prompt('Write amount of money');
if (!ammountOfMoney || ammountOfMoney < 1000) alert('Invalid input data');
let numberOfYears = prompt('Write number of years');
if (!numberOfYears || numberOfYears < 1) alert('Invalid input data');
let percentageOfYear = prompt('deposit interest?');
if (!percentageOfYear || percentageOfYear > 100) alert('Invalid input data');
alert(`Initial amount: ${ammountOfMoney} \nNumber of years: ${numberOfYears}\nPercentage: ${percentageOfYear}`);