Coding with AppLab
This is a project done by Paaras Purohit (me) and AJ Ruiz. This is our first app coded with AppLab, and we created a very simple quiz. The language used was JavaScript, a language mainly used for programming HTML behavior. It is famous for having a large amount of libraries, as well.
APCSP Create Performance Task Requirements Met:
-
Program Purpose and Function - The purpose was to create a simple quiz that implemented the CPT Requirements
-
Data Abstraction - I used different screens that looked at stored values of "right" or "wrong," and output the correct message for the user's answer, whether it was wrong or right.
-
Managing Complexity - Since this was a quiz, complexity was not always needed, but the code is efficient and does not take too long to run, despite its length.
-
Procedural Abstraction - The code written for the quiz, I believe, can defintely be applied to other relevant situations.
-
Algorithm Implementation - Using if-else statements and checking what is being inputted when, I was able to create simple algorithms that completed the task.
-
Testing - There was some syntax error here and there, but no major errors to report.
account = {
"Username":[],
"Password":[],
"Amount":0,
}
print("Hello, please create an account >>")
account["Username"].append(input("Enter Username >>"))
account["Password"].append(input("Enter Password >>"))
def deposit_or_withdraw():
action = input("Hello, " + str(account["Username"]) + ", would you like to deposit or withdraw today?")
if action == "deposit":
deposit()
elif action == "withdraw":
withdraw()
elif action == "exit":
print()
else:
deposit_or_withdraw()
def deposit():
amount = input("Amount you would like to deposit?")
account["Amount"] += int(amount)
print("Successfully deposited. Your balance is now " + str(account["Amount"]))
deposit_or_withdraw()
def withdraw():
amount = input("Amount you would like to withdraw?")
if int(amount) > account["Amount"]:
print("You do not have enough money.")
deposit_or_withdraw()
else:
account["Amount"] -= int(amount)
print("Successfully withdrawn. Your balance is now " + str(account["Amount"]))
deposit_or_withdraw()
deposit_or_withdraw()