Skip to content

Instantly share code, notes, and snippets.

@enigmatikme
Created August 30, 2018 17:00
Show Gist options
  • Save enigmatikme/57d3027efb381efb0d4775762caef370 to your computer and use it in GitHub Desktop.
Save enigmatikme/57d3027efb381efb0d4775762caef370 to your computer and use it in GitHub Desktop.
//No pseudocode as requested by prompt
function CashAmount(val) {
this.val = val;
console.log(this.val);
}
CashAmount.prototype.totalInPennies = function(val) {
return this.val * 100;
}
CashAmount.prototype.quantityOfEachDenomination = function() {
var denominations = {};
}
CashAmount.prototype.addDoubleAmount = function(val) {
var newVal = this.val + val;
console.log(newVal);
this.totalInPennies(newVal);
this.val = newVal;
return newVal;
}
CashAmount.prototype.toDoubleString = function() {
var stringify = this.val;
return stringify.toString();
}
CashAmount.prototype.toDouble = function(val) {
var newVal = this.val + val;
this.totalInPennies(newVal);
return this.val + val;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment