Goal: Practice bringing together everything we've learned in this section by creating a project that includes custom functions, branching, forms, and event listeners.
Everyone should complete the "Triangle Tracker" project first. Once you've completed it and have more time in class, build the "Online Marketplace" project.
Make a web page that allows the user to input the lengths of the sides of a triangle, and returns whether these sides form an equilateral, isosceles, or scalene triangle, or if the sides cannot make a triangle at all. Here are the definitions of each possibility:
In your code, make sure to use the following:
Once your application is functioning correctly, try to refactor your code as much as possible to make your code easy to understand and read, and so that your UI and business logic is separated.
Optionally, add CSS to your Triangle Tracker. If you haven't already, try using Bootstrap!
Create a website that sells a specific product. Create a form that allows buyers to select a product to purchase. If your online marketplace sells jewelry, include form fields denoting whether they're ordering a bracelet, necklace, or earrings. Make sure to take in the buyer's shipping and payment information in this form.
When the buyer submits the form, use branching to add a discount to the order based on what the user has selected to purchase. You can make this as complicated or as simple as you like.
Then, display a receipt with all of the order information back to the user, including the discounted price.
As you code, make sure to use the debugging tools you have learned about in this course section.
Once your application is functioning correctly, try to refactor your code as much as possible to make your code easy to understand and read, and so that your UI and business logic is separated.
Add CSS to your online store to make it look more professional or inviting. Or add a stylistic theme that matches whatever your store is selling.