Question: Topics and learning objectives! 1 . Reading and writing files 2 . Model - View - Controller 3 . Session variables 4 . Object -

Topics and learning objectives!
1. Reading and writing files
2. Model-View-Controller
3. Session variables
4. Object-Oriented Programming
Task Description
The aim of this assignment is to build upon the online store that you created in Assignment 1, to make
it more sophisticated.
Start by copying your code from Assignment 1(at `~/public_html/assignments/assignment1/`)
into your new directory for Assignment 2(at `~/public_html/assignments/assignment2/`).
This will be your starting code for Assignment 2.
If you didnt complete Assignment 1, or dont have access to your code for some reason,
there will be some sample starting code available on Brightspace.
Task Description (cont.)
Specific tasks and requirements of the assignment are listed later in this manual.
Here is a broad overview of the changes that we will be applying to our starting code:
Adding MVC patterns to the application.
We will create new files and move code around as needed to meet the MVC design patterns.
Using OOP to create classes that represent our products and categories.
These classes will be defined in the Model, and then used by the View and Controller.
Storing the product data in a csv file, instead of an array.
The Model component of the application will handle interactions with the csv file,
using the relevant class (e.g., the Product class works with products.csv).
Using session variables to store information about selected category and products.
Task Requirements
1. Your code should be clean, and follow good coding practises [5 Marks].
Good code will have the following qualities:
i. Comments are used to explain the logic of your code.
No need to explain basic code, syntax, etc. Instead, explain why your code is written a
certain way (e.g., what your if-statement is checking, what your array represents, etc.).
ii. Variables have sensible, human-readable names (e.g., $categories is better than $c).
iii. Use indentation inside if-statements, loops, function definitions, multi-line arrays, etc.
iv. Proper spacing around operators, function parameters, etc. (e.g.,
$choice == $categories[$i] is better than $choice==$categories[$i])
v. No redundant code (i.e., code that doesnt do anything, or is just used for testing, etc.)
2. Any PHP file that you make should have the following code at the bottom, so that the source
code is shown on the page [1 Mark].
echo "

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!