0% found this document useful (0 votes)
51 views3 pages

Spring 2024 - CS301 - 1

Uploaded by

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

Spring 2024 - CS301 - 1

Uploaded by

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

Assignment No.

01
Total Marks: 20
SEMESTER Spring 2024
Due Date: 29-April, 2024
CS301- Data Structures

Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
o The assignment is submitted after the due date.
o The submitted code does NOT compile.
o The submitted assignment is other than .CPP file.
o The submitted assignment does NOT open or file is corrupted.
o The assignment is copied (from other student or ditto copy from handouts or internet).
Uploading instructions
For clarity and simplicity, you are required to Upload/Submit only ONE .cpp file.

Note: Use ONLY Dev-C++ IDE.


Objective
The objective of this assignment is

o To make you familiar of Programming with List Data Structure.

For any query about the assignment, contact at [email protected]

GOOD LUCK
Marks: 20

You are required to implement a simple Shopping List Manager using ArrayList data structure. The program
must meet the following requirements.

1. Write a C++ program that allows users to manage a shopping list.


2. Use ArrayList data structure to store items in the shopping list.
3. Your program should contain the following functionalities.
a. Add item to the shopping list.
b. Remove items from the shopping list.
c. View current items in the shopping list.
d. Clear the shopping list (i.e. remove all items).
e. Exit the program.
4. The program should display a menu to the user and allow them to choose options using numbers.
5. Ensure error handling for invalid inputs.
6. Use Object oriented programing principles where applicable.
An output screenshot is given at the end of this file for your complete understanding and reference.

Note: Don’t use ArrayList Built in library for assignment development. You must follow the following program
structure for naming and to build the program. Otherwise, you will get ZERO marks.

Program Structure:
Class: ShoppingList
Attributes:
1. Items[100] : string
2. ItemCount: int

Explicit Default Constructor:


1. ShoppingList()
Functions:
1. addItem(…) //Where … represents function takes parameters.
2. removeItem(…) //Where … represents function takes parameters.
3. viewList()
4. clearList()

Default Function:
1. main()

Sample Output:
Lectures Covered: This assignment covers Lecture # 1-4.
Deadline: Your assignment must be uploaded/submitted at or before, 29-April, 2024.

You might also like