0% found this document useful (0 votes)
60 views2 pages

Sir Syed CASE Institute of Technology, Islamabad: CS2301L Object Oriented Programming Lab

The document provides instructions for developing an application for an online shopping website that sells shoes and laptops, with classes for Item, Shoe, Laptop, Shop, and Main that allow adding and displaying inventory with calculated discounted prices, with subclasses overriding calculation methods and extra discounts for certain items. Students are to implement the classes and application functionality according to the provided flow and requirements and will be marked based on implementing the correct classes.

Uploaded by

Wasie Urrahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views2 pages

Sir Syed CASE Institute of Technology, Islamabad: CS2301L Object Oriented Programming Lab

The document provides instructions for developing an application for an online shopping website that sells shoes and laptops, with classes for Item, Shoe, Laptop, Shop, and Main that allow adding and displaying inventory with calculated discounted prices, with subclasses overriding calculation methods and extra discounts for certain items. Students are to implement the classes and application functionality according to the provided flow and requirements and will be marked based on implementing the correct classes.

Uploaded by

Wasie Urrahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sir Syed CASE Institute of Technology, Islamabad

BSCS/BSSE/BSAI
Mid Examinations Spring 2021

CS2301L Object Oriented Programming Lab

Total Marks: 50 Time Allowed: 2 Hours

Develop an application for an online shopping website which sells different items like shoes,
laptops, shirts, crockery etc. You are required to deal with two items only; Shoes and Laptops.
Shoes and Laptops are two Items that are sold in the Shop. You will maintain appropriate data
members and methods for the items. Following is the basic flow of application:
1. There will be total of five classes; Shop, Item, Shoe, Laptop and Main
2. Abstract Item Class:
a. Item class has data members ID, Price, Discount_Percentage and Brand
b. Pure virtual method int calculateDiscountedPrice() that will calculate the total
price after applying discounts.
3. Laptop Class inherits Item Class:
a. Laptop class has data members: Processor, RAM, HardDisk_Type
b. Implementation of int calculateDiscountedPrice(), use Price &
Discount_Percentage to calculate the discounted price, note that we are not
giving any discount on SSD type HardDisk, so you need to check here if hard
disk is SSD type, then discounted price equals actual price.
4. Shoe Class inherits Item Class:
a. Shoes class has data members: Shoe_type, Color and Size.
b. Implementation of int calculateDiscountedPrice(), use Price &
Discount_Percentage to calculate the discounted price, note that we are giving
30% extra discount on white color shoes since we have too much stock of white
shoes, so total Discount_Percentage is Discount_Percentage + 30%.
5. Shop Class:
a. Shop class has a pointer vector of Item as a data member, vector<Item*> items
b. addItem(Item *item) method that takes input an item and adds it to the vector
of items.
c. getAllItems() function that returns all items in the store
6. Main Class:
a. Main class should display the following menu on the screen:
Press 1 to add Item
Press 2 to get all available Items

b. Pressing 1 should display the following sub-menu

Press 1 to add Shoe


Press 2 to add Laptop

7. Information should be displayed using display() method which should invoke


calculateDiscountedPrice() method to display Discount Price along with other data
members

8. All required classes should have default constructors and parameterized constructors
with a call to super constructor (if any), display() method with a call to super display()
(if any) and getters & setters.

Marks distribution:

Class Name Marks


Item Class 10
Laptop Class 10
Shoe Class 10
Shop Class 10
Main Class 10
Total 50

You might also like