Programming Paradigm
Programming Paradigm
Programming Paradigm
Assignment
Problem 1: The admin hard to update the price once being put the product want to sell
online.
Problem 2: The admin cannot add the new selection to the product in the same category
Problem 3: Customer difficult and hard to find specific item or brand
Problem 4: Customer don’t know where to ask the question and only one email stated on
there even for different types of question.
SDLC Model:
Waterfall model is choosed as model for developing the software. The waterfall model
maintains that one should move to a phase only when it’s preceding phase is reviewed
and verified.
Althought it may exist the problem like clients may not know exactly what their
requirements are before they see working software and so change their requirements,
leading to redesign, redevelopment, and retesting, and increased costs. But since that it is
just a small software so it should be not a big problem.
Software Requirement:
1. Log in account of admin or customer
2. Admin can insert new item in.
3. Admin can delete item that exist.
4. Admin can update the price of item.
5. Admin can view all item.
6. Customer can clear all the item.
7. Customer can buy an item according category.
8. Customer can search by brand or code of item.
9. Customer can view what they had bough
10. Customer can make complaint or ask further question.
Software Design:
Software Implementation:
Develop the software by using C. Because c is more easier to use compare to python.
Software Testing:
Test for the program:
Unit Test
We would like to test for the log in interface. We want to find out what will happened
when we enter the wrong input: out of range of option and not number (int). On the same
time, we will also test whether it will go to the function that we want when we enter the
valid input (1, 2 and 0).
Test cases:
Test case Output Expected output Success or Fail
1. Enter 1 1 1 Success
2. Enter 2 2 2 Success
3. Enter 6 0 0 Success
4. Enter “^” 0 0 Success
5. Enter 0 0 0 Success
When we enter 1 the system will go to the admin() function, so in test case we set that it
consider success if return 1.
When we enter 2 the system will go to the user_main() function, so in test case we set
that it consider success if return 2.
When we enter 6 which is out of range, the system will print “Wrong Choice”, in test
case we set that it consider success if return 2.
When we enter “^” which is not a number, the system will terminate, in test case we set
that it consider success if return 0.
When we enter 0 which mean exit the system, in test case we set that it consider success
if return 0.
Figure 1
Figure 4 prove that the new item that we just insert is now in the database with the first
column is code, second is name of item, third column is the brand name, while forth
column is price and fifth column is the category (ph for phone, tab for tablet, ep for
earphone).