IFB104 Building IT Systems

IFB104 Building IT Systems

[ad_1]

IFB104 Building IT Systems
Semester 1, 2020
Assignment 2, Part B: Orders Database
(4%, due 11:59pm Sunday, May 24th, 2020)
Overview
This is the second part of a two-part assignment. This part is worth 4% of your final grade for
IFB104. Part A which preceded it was worth 21%. This part is intended as a last-minute
extension to the assignment, thereby testing the maintainability of your solution to Part A and
your ability to work under time pressure. If you have a neat, clear solution to Part A you will
find completing Part B much easier. For the whole assignment you will submit only one solution, containing your combined response to both Parts A and B, and you will receive one grade
for the whole 25% assignment.
Goal
In Part A of this assignment you built a significant “IT system” which provided an online shopping experience for its stay-at-home users, allowing them to select categories of products to
buy and to add them to a “shopping cart.” Here you will extend your application so that it
saves a copy of the chosen products in a database. The extension is shown in blue below.
The database represents the customers’ sales orders to be filled by the various product suppliers
and persists even after the Python program has terminated.
To complete this part of the assignment you must extend the Python code you have already
written so that the shopper can choose to update the database with their shopping cart’s contents
whenever they like. Your program must save a copy of the shopper’s current “shopping cart”
IFB104 Building IT Systems
Semester 1, 2020
of products in a supplied SQLite database, orders.db. A copy of this database accompanies
these instructions. It contains a single table, CustomerOrders, which has two columns,
Product and Price. Your program must insert the name and price of each item currently
in the shopper’s cart into this table.
You should assume the database already exists when your program is started. Only the current
contents of the cart should appear in the database, so your program must delete all rows in the
table, if any, before inserting new rows. The product names and prices should appear in the
database exactly as they appear in the original web site. In particular, prices should be in the
same currency as in the original web documents from which they were extracted; there is no
need to do currency conversions.
Illustrative example
Supplied with these instructions is an empty SQLite database called orders.db. If you open
it in the DB Browser for SQLite or an equivalent tool you will see that it contains a single table,
CustomerOrders, which has two columns, Product and Price, as shown below.
In the instructions for Part A we used a demonstration program which we called the Pandemic
Products online shopping application. Here we extend its capabilities so that the shopper can
update the “orders” database whenever they like. To illustrate this, in the following example
we add some product categories to our shopping cart and then copy the products into the database.
Firstly, we look at the “Survival Gear” category and add it to our shopping cart, as shown
overleaf. This is one of our “static” categories, so the products on offer haven’t changed since
we ran our Part A solution; the data is extracted from the same previously-stored file.
IFB104 Building IT Systems
Semester 1, 2020
Now, however, our updated GUI features a button labelled “Submit order”. Pressing this button causes our program to write the current contents of the shopping cart into the “orders”
database, as shown below.
IFB104 Building IT Systems
Semester 1, 2020
Next we decide to check one of our “live” product categories, in this case the best-selling
“Medical Supplies” available at Amazon.
We discover that this category has changed significantly since we checked it in the Part A
instructions. Compare the list above with those from the Part A instructions to confirm that it
has been updated since those instructions were written. The products shown above were on
offer on May 15th, 2020. Despite the update to the source web site, our program continues to
work correctly thanks to flexible use of pattern matching to exrtract the necessary document
elements.
Excited by this discovery, our intrepid shopper decides to inspect the products further and
presses the “Show images” button, which generates the HTML document shown overleaf.
IFB104 Building IT Systems
Semester 1, 2020
Determined to get even more face masks, the shopper adds all of these products to the shopping
cart and presses the “Submit order” button again.
IFB104 Building IT Systems
Semester 1, 2020
This results in all ten items currently in the shopping cart (five from the “Survival Gear” category and five from the “Medical Supplies” category) being written into the SQLite database.
Notice that the “survival gear” items do not appear in the database twice. This is because our
program deletes all of the table’s contents before copying the shopping cart’s current list of
products into the database.
IFB104 Building IT Systems
Semester 1, 2020
NB: The order in which items appear in the table is not important. Recall that the order of
columns and rows in a relational database table is irrelevant. In the screenshot above the items
are listed in the order they appeared in the HTML invoice, but in some DB Browser for SQLite
implementations the order in which the rows are displayed may be different.
Your task is to extend your solution to Part A of the assignment with a database storage capability equivalent to that above. However, you do not need to duplicate our approach. A number
of GUI solutions are possible. We used a pushbutton widget which the user presses in order to
save the cart, but you could equally well implement a “save mode” checkbox or radiobuttons
which can be toggled so that the current cart contents are stored automatically whenever they’re
updated, etc. The main thing is that the user has full control over when products are stored in
the database.
Supporting material
Accompanying these instructions we have provided a copy of the necessary SQLite database,
orders.db. It contains a single table, CustomerOrders, which has two columns, Product and Price. As supplied the database table is empty. Your solution should assume that
this database and its table already exists in the same folder as your Python program. Your
program does not need to create the database or the table. Before you begin you should confirm
that you can open this database with the DB Browser for SQLite or a similar database tool. (Do
not drag-and-drop the database file into the DB Browser’s GUI. On some systems this causes
the DB Browser to ask for a password, even though the database is not password-protected.)
For the purposes of this assignment the definition of the CustomerOrders table is very
simple, merely two fields of type Text, with Product as the primary key. This means that
you won’t be able to insert the same product twice, even if the prices are different, but it
shouldn’t be the case that the same product appears more than once in your shopping cart anyway.
Development hints
• It should be possible to complete this task merely by adding code to your existing solution, with little or no change to the code you have already completed.
• The SQLite statements needed to complete this task are quite simple. Similar examples
can be found in the relevant lecture demonstrations and workshop exercises.
• If you are unable to complete the whole task, just submit whatever parts you can get
working. You will receive partial marks for incomplete solutions.
Requirements and marking guide
To complete this task you are required to further extend the provided stay_home_shopping.py template file with your solution to Part B, on top of your solution to Part A, to
provide a data storage capability equivalent to that illustrated above.
The extension for Part B must satisfy the following criteria. Marks available are as shown.
• Widget(s) for choosing to store the shopping cart (1%). Your GUI must provide
some simple, intuitive feature to allow the user to control when the shopping cart’s
contents are stored in the database. The user must be able to request that the database’s
contents are updated whenever and as often as they like.
IFB104 Building IT Systems
Semester 1, 2020
• Shopping cart can be stored in the database (3%). The contents of the shopping cart,
i.e., the product names and prices, can be stored any time the user wants. Each time the
user chooses to do so, the previous database contents, if any, are overwritten. Your
Python code should assume that the necessary SQLite database already exists in the
same folder as your Python program.
You must complete this part of the assignment using only basic Python features and the
sqlite3 module.
Deliverables
You must develop your solution by completing and submitting the provided Python template
file stay_home_shopping.py. Submit this in a “zip” archive containing all the files
needed to support your program as follows:
1. Your stay_home_shopping.py solution. Make sure you have completed the
“statement” at the beginning of the Python file to confirm that this is your own individual work by inserting your name and student number in the places indicated. Submissions without a completed statement will be assumed not to be your own work.
2. One or more small GIF files needed to support your GUI interface, but no other image
files.
3. Copies of the two previously-downloaded web documents used for your “static” product categories. Include only a single HTML document for each category. Do not include any image or style files associated with the web document. Only the HTML
source code is needed by your Python program. (All files needed for your viewing
product images must be sourced from online when your exported HTML document is
viewed in a web browser.)
4. A copy of the orders.db database as provided with these instructions. Ensure that
the database’s CustomerOrders table is empty when you submit your solution so
that the marker can clearly see your Part B solution adding data to it.
Once you have completed your solution and have zipped up these items submit them to Blackboard as a single file. Submit your solution compressed as a “zip” archive. Do not use
other compression formats such as “rar” or “7z”.
Apart from working correctly your Python and HTML code must both be well-presented and
easy to understand, thanks to (sparse) commenting that explains the purpose of significant elements and helpful choices of variable and function names. Professional presentation of your
code will be taken into account when marking this assignment.
If you are unable to solve the whole problem, submit whatever parts you can get working. You
will receive partial marks for incomplete solutions.
Portability
An important aspect of software development is to ensure that your solution will work correctly
on all computing platforms (or at least as many as possible). For this reason you must complete
the assignment using standard Python 3 modules and functions only. You may not import
any additional modules or files into your program other than those already imported by the
given template file. In particular, you may not use any Python modules that need to be
IFB104 Building IT Systems
Semester 1, 2020
downloaded and installed separately, such as “Beautiful Soup” or “Pillow”. Only modules that are part of a standard Python 3 installation may be used.
Security warning and plagiarism notice
This is an individual assessment item. All files submitted will be subjected to software plagiarism analysis using the MoSS system (http://theory.stanford.edu/~aiken/moss/). Serious violations of the university’s policies regarding plagiarism will be forwarded to the Science and
Engineering Faculty’s Academic Misconduct Committee for formal prosecution.
As per QUT rules, you are not permitted to copy or share solutions to individual assessment
items. In serious plagiarism cases SEF’s Academic Misconduct Committee prosecutes both
the copier and the original author equally. It is your responsibility to keep your solution secure.
In particular, you must not make your solution visible online via cloud-based code development platforms such as GitHub. Note that free accounts for such platforms are usually
public and are thus unsafe. If you wish to use such a resource, do so only if you are certain
you have a private repository that cannot be seen by anyone else. For instance, university
students can apply for a free private repository in GitHub to keep their assignments secure
(https://education.github.com/pack). However, we recommend that the best way to avoid being prosecuted for plagiarism is to keep your work well away from both the Internet and your
fellow students!
How to submit your solution
A link is available on Blackboard under Assessment for uploading your solution before the
deadline (11:59pm Sunday, May 24th). Note that you can submit as many drafts of your solution as you like. You are strongly encouraged to submit draft solutions before the deadline as
insurance against computer and network failures. If you are unsure whether or not you have
successfully uploaded your file, upload it again!
Students who encounter problems uploading their assignment files to Blackboard should contact HiQ’s Technology Services (http://qut.to/ithelp; askqut@qut.edu.au; 3138 2000) for assistance and advice. Do not email assignments to the teaching staff. They cannot be accepted
for marking because we cannot upload assignments to Blackboard on your behalf. Also, teaching staff will not answer email queries on the weekend the assignment is due, so ensure that
you have successfully uploaded at least one solution by close-of-business on Friday, May 22nd.

[Button id=”1″]

[ad_2]

Source link

"96% of our customers have reported a 90% and above score. You might want to place an order with us."

Essay Writing Service
Affordable prices

You might be focused on looking for a cheap essay writing service instead of searching for the perfect combination of quality and affordable rates. You need to be aware that a cheap essay does not mean a good essay, as qualified authors estimate their knowledge realistically. At the same time, it is all about balance. We are proud to offer rates among the best on the market and believe every student must have access to effective writing assistance for a cost that he or she finds affordable.

Caring support 24/7

If you need a cheap paper writing service, note that we combine affordable rates with excellent customer support. Our experienced support managers professionally resolve issues that might appear during your collaboration with our service. Apply to them with questions about orders, rates, payments, and more. Contact our managers via our website or email.

Non-plagiarized papers

“Please, write my paper, making it 100% unique.” We understand how vital it is for students to be sure their paper is original and written from scratch. To us, the reputation of a reliable service that offers non-plagiarized texts is vital. We stop collaborating with authors who get caught in plagiarism to avoid confusion. Besides, our customers’ satisfaction rate says it all.

© 2022 Homeworkcrew.com provides writing and research services for limited use only. All the materials from our website should be used with proper references and in accordance with Terms & Conditions.

Scroll to Top