Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

The goal of the fourth project is to add 1 extra feature to the Web application developed in Project #3

Computer Science Dec 07, 2021

The goal of the fourth project is to add 1 extra feature to the Web application developed in Project #3. In order to achieve that, we will use Python, Flask, PyMongo, HTML, CSS, JS, and 1 new API.

Preliminaries

  1. Create a new project in the PyCharm IDE
    1. Name the project as Project4
    2. Select new environment as virtualenv
    3. Select Python version 3.8
  2. Install and import packages Flask, Flask-WTF, wtformsdnspythonFlask-PyMongoand requests

Copy from Project 3 all the files, except venv (since you configured a new virtual environment in Project #4).

The project will have the follow hierarchy:

> <strong>Project4
</strong>>> app.py
>> <strong>static
</strong>>>><strong> css
</strong>>>> <strong>images
</strong>>>> <strong>js
</strong><strong></strong>>> <strong>templates
</strong>>>> addExpenses.html
>>> expensesAdded.html
>>> index.html
>>> template.html

(In bold: directories)

In this modified WebApp, the user needs to log some expenses based on the following fields:

  • Description (for example, café con leche)
  • Category (for example, restaurants)
  • Cost (for example, 3.50)
  • Currency (for example, Brazilian Real)
  • Date (for example, 11/02/2020)

Nonetheless, notice that we have a new field, a dropdown menu, for the user to choose the currency. Please sign up for the currencylayer API. This is a reliable exchange rates and currency API used for conversion for your business applications. It provides real-time JSON API for 168 world currencies.

A snippet of the function you should add with the http endpoint is:

def currency_converter(cost,currency):
    url="http://api.currencylayer.com/live?access_key=YOUR_KEY_GOES_HERE"
    response = requests.get(url).json()
    ### YOUR TASK IS TO COMPLETE THIS FUNCTION
    return converted_cost

Don't forget to paste your unique API key to the url string.

Your job is to finish this new function above in the app.py script file to convert from the selected currency to US Dollar. For example, the user can choose among some currencies, such as Colombian Peso, so the application will need to convert that entry/value to US Dollar before inserting that document to the databases. In other words, your application only displays values in US Dollars, but it is able to accept values in other currencies entered by the user.

The main page should remain the same as the one in Project #3. The following video shows an example of the features and mechanisms of this WebApp:

Please submit a .zip file to this assignment page.

Expert Solution

1 - Create file requirements.txt that contains all packages needed for running the project 2 - install packages using requirement.txt with command line pip install -r requirements.txt 3 - paste all project3 files except venv 4 - create app.py import librairies 5 - create index function that redirect to index.html 6 - index.html contains design and event click 7 - Link post method with app.py function currency_converter and call api to get value of chnages 8 - render html file and send with the value of change

please download the answer file using this link

https://drive.google.com/file/d/1wsFfUhg_6Hind905cNzCkLDupEJ9pvlz/view?usp=sharing

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment