The year is 2025 and the entire banking system has been delegated to robots. You are forced to deal with your new loan officer aptly named LoanBot.
Your homework is to create an interactive ChatBot lending program called LoanBot.
You will be doing all of your work inside of the homework
directory. We have provided the index.html
, script.js
, and style.css
for you already.
Whenever the user types in the prompt
field and presses the return/enter
key, append a <li>
with the value of the text value of the prompt
to the ul#log
, and then reset the value of the prompt
. LoanBot's response should be appended as <li>
tags beneath the prompt
in the ul#log
. Create each <li>
with three possible classes:
prompt
: command from theprompt
.emote
: Indicates a LoanBot actionloanBot
: For LoanBot's replies
(Hint: You will be using an event listener to capture the keystrokes)
This is the command you type
- This is LoanBot's response
LoanBot starts off with $10,000
.
purse
- LoanBot has 10000 dollars
LoanBot should be able to loan money.
loan Bobby 50 dollars
- LoanBot gives Bobby 50 dollars Be sure to update the purse
LoanBot keeps track of his debts
ledger
-LoanBot pulls out ledger
- Bobby owes you 50 dollars
- Jaden owes you 30 dollars
LoanBot can collect interest on debts and set interest rate
collect interest
- LoanBot collects interest at 35%
- Bobby now owes me 67.50 dollars
- Jaden now owes me 40.50 dollars
set interest rate at 15%
- Loanbot adjusts interest rate from 35% to 15%
LoanBot can collect debts
collect 50 dollars from Bobby
- LoanBot opens his purse and collects Bobby's 50 dollars of Bobby's debt