0
Help with using empty strings
So I have a program that returns the smallest amount of coins necessary to get the number entered by the user, and now I'm supposed to modify the program to display quarters when necessary instead of always saying quarter. I'm supposed to use empty strings to do this, can someone help? Thanks! https://code.sololearn.com/WWuH1Uln935H/#html
2 odpowiedzi
+ 9
var plural = "";
if(totalq > 1)
plural += "s";
Then print the plural string at the end of "quarter(s)". So: "quarter"+plural+...etc
0
Thanks!