C2005 Object Oriented Programming in Java Term 2 2008 Assignment
Hi everyone!
This is the third and the last post for the first part of IADIC assignment series. This time I will post about the assignment from C2005 OOP in Java that I take in Term 2 2008. This module basically teach about how to make and use objects in Java in a very simple way, so don’t expect to get an advanced Java technique here as it is a very basic Java skill that is taught by this module.
The assignment that I get in Term 2 2008 asked me to make a simple program for an electronic shop.
here is the questions:
Part A ( Total 15 marks )
An electronic shop supposed to store information on electronic product to be sold. Each component will contain id, brand name, price and other two members. This part requires you to write the class, declare the members, write the constructors, and methods of it.
Part B ( Total 25 marks )
This part requires you to make use of array to store the above information.
Add more features to the program in Part A with the following specifications:
i. The program can display all the electronic information. ( 5 marks )
ii. The program can store new electronic product inside the array.( 5 marks )
iii. The program can search for electronic product information based on a given brand. ( 5 marks )
iv. The program can update the available electronic information. ( 5 marks)
v. One feature other than those stated in part B. ( 5 marks )
What do you need to submit?
a) softcopy of your program
b) printed copy of your program
c) printed documentation on testing of your program
The answer
II. Program Listing
The program for part A is the “ElectronicShop.java”
(Click the following link to download and see the file)
electronicshop.java
The program for part B is the “ShopProgram.java”. This file is saved in the same folder with the previous file, ElectronicShop.java
(Click the following link to download and see the file)
shopprogram.java
III. Program Objectives
The objectives of this Electronic Shop program are:
a) To help an electronic shop to organize and manage its electronic products
b) To provide easier access for the shop assistant to display all available product
c) To help the electronic shop search for a product detail in their store
d) To make updating a product’s detail become easier
e) To assist the Electronic Shop to sell its product
f) To help the electronic shop manage how many items left in the stock
IV. Program Test Documentation
IV. a) Test Plan
| Test No. | Test Description | Action |
| 1 | To test that “ElectronicShop.java” can run after we compile it | Compile and run ElectronicShop.java |
| 2 | To test that “ShopProgram.java” can run after it is compiled | Compile and run ShopProgram.java |
| 3 | To test that main menu appear after we run and press “ok” | Press ok |
| 4 | To test that we cannot enter other choice number outside the main menu option | Enter 7 in main menu |
| 5 | To test that we can use the “ShopProgram.java” to add new item using the add module | Choose 1 in main menu then enter the product detail |
| 6 | To test that display module can display all the products that we have entered | Choose 2 from main menu |
| 7 | To test that we can search for a product based on the product’s brand | Choose 3 from main menu |
| 8 | To test that we able to open update product module | Choose 4 from the main menu |
| 9 | To test to update a product’s brand | Choose 1 from update module menu |
| 10 | To test to update a product’s stock quantity | Choose 2 from update module menu |
| 11 | To test to update a product’s price | Choose 3 from update module menu |
| 12 | To test to update a product’s discount | Choose 4 from update module menu |
| 13 | To test exit the update module | Choose 5 from update module menu |
| 14 | To test running the buy module | Choose 5 from main menu |
| 15 | To test buying a product using the buy module | Enter purchase detail |
| 16 | To test to exit the program | Choose 6 from main menu |
IV. b) Test Case & Test Result
| Test case | 1 |
| Objectives | To test that “ElectronicShop.java” can run after we compile it |
| Test action | Compile and run ElectronicShop.java |
| Expected result | ElectronicShop.java runs correctly without error |
| Actual result | As shown Below |
| Conclusion | Successful |
Before
The screenshot before the test is carried out here
After
Screenshot after the test action is executed here
IV. c) Test Log
| Test Case | Test Result |
| 1 | Successful |
| 2 | Successful |
| 3 | Successful |
| 4 | Successful |
| 5 | Successful |
| 6 | Successful |
| 7 | Successful |
| 8 | Successful |
| 9 | Successful |
| 10 | Successful |
| 11 | Successful |
| 12 | Successful |
| 13 | Successful |
| 14 | Successful |
| 15 | Successful |
| 16 | Successful |
REFERENCES
Shang Shin, javapassion.com, Retrieved on June 29, from http://www.javapassion.com/
Extra notes from me:
You may notice that the program is not perfect in validating input, it will crash and stop working when a wrong data type is entered. OF course actually you can fix this problem and make the program validate the input appropriately. But what I want to show here is that this module assignment really doesn’t care about this kind of factors, they just want the program to do the requested functions. But if you want to do more, the choice is always yours
good luck!
Do you have any comment on this? maybe you have something to ask me or want to discuss with me about this?Or maybe you are IDIC student and taking this module also?
Feel free to use the comment box below (click here if you cannot see the comment box).
Coming next, I will post another IADIC assignments, I will start posting my second term modules in IADIC.
Stay tuned! you can subscribe to my blog’s feed by clicking here so you won’t miss when the new post is published



Good night .
I have something to say, about Aloe Vera, something about which you wrote above, about health and weight management… For a long time, I and my nice friend use the products of the Forever Living Products. We at all times see the good results and also we make money for our families and we are happy. My friend works with aloe Vera in the company of Forever Living Products has more than 5 years (My friend works ONLY in the FLP and has a wife and three children). I know aloe products for skin care for a long time, but a year ago, began working as a distributor in the forever living.
Of course, the job is not easy, but in no other case, you can earn so much much money with so much much fun and good smiling faces around..
So if you want to discuss something about your article, and about my experience with Aloe vera products for skin care, I’ll always be glad to talk.
Best regards from Seattle and have a nice day!
Andrew – Aloe Vera Distributor
Могу увеличить посещаемость Вашего сайта в разы за небольшую плату.Если интересует,отпишите!Спасибо.
Спасибо:)
Незнакомые ссылки monthly,NotPlag…которые по-видимому мешают открыть страницу до конца.
Привет Что вы подразумеваете под мешает нам ссылку, чтобы открыть страницу до конца?
Как зарегиться на сайте? Что-то не догоняю ):
Привет, можете ли вы указать ошибку, пожалуйста?
thanks for this one. really useful