I need help to fix a minor issue
<p>Basically I want the word problem to present this, Johnny has 1 nickel(s), 4 dime(s) and 3 quarter(s). How much money does Johnny have? (answer: $1.20)
But every time I change it my code it doesn't work.</p>

<p>This is the code that I wrote and need help to change the word problem.</p>

<pre><code>&lt;script&gt;
 var person1, person2;

 function getPeople() {
     var people = ['Kritarth', 'Sharujan', 'Anveer', 'Krishna', 'Husnain', 'Iser', 'Ishan', 'Harman', 'Hemant', 'Harjot'];

     person1 = people[Math.floor(Math.random() * people.length)];
     person2 = people[Math.floor(Math.random() * people.length)];

     while (person1 === person2) {
         person2 = people[Math.floor(Math.random() * people.length)];
     }
 }

 function getrandomnumber(min, max, notin) {
     return min + Math.floor((max - min + 1) * Math.random());
 }

 function getoption(s, ch, num) {
     var a = s.split(ch);
     return a[num - 1];
 }

 var marymoney = getrandomnumber(50, 100, "");
 var johnmoney = getrandomnumber(50, 100, "");
 var maryitem = getrandomnumber(5, 20, "");
 var johnitem = getrandomnumber(5, 20, "");
 var marystuff = getoption("notebook,pencil,ruler,pen,eraser,binder,backpack", ",", getrandomnumber(1, 7));

 var johnstuff = getoption("notebook,pencil,ruler,pen,eraser,binder,backpack", ",", getrandomnumber(1, 7));

 while (marystuff === johnstuff) {
     johnstuff = getoption("notebook,pencil,ruler,pen,eraser,binder,backpack", ",", getrandomnumber(1, 7));
 }
 getPeople();
 var totalleft = marymoney + johnmoney - maryitem - johnitem;
 var str = person1 + " has $" + marymoney + " and " + person2 + " had $" + johnmoney + ". " + person1 + " buys a " + marystuff + " for $" + maryitem + " and " + person2 + " buys a " + johnstuff + " for $" + johnitem + ". They have $" + totalleft + ".";

 document.write(str);
&lt;/script&gt;
</code></pre>