0% found this document useful (0 votes)
11 views1 page

Assignment#1

The document outlines a lab activity for programming tasks involving arrays. It includes four problems: searching for an element, inserting a new element, and deleting an element from an array, with specific requirements for user input. Evaluation criteria focus on functionality, logic, code structure, and documentation.

Uploaded by

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

Assignment#1

The document outlines a lab activity for programming tasks involving arrays. It includes four problems: searching for an element, inserting a new element, and deleting an element from an array, with specific requirements for user input. Evaluation criteria focus on functionality, logic, code structure, and documentation.

Uploaded by

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

Khadija ilyas DS Lab Week 02

Activity

Evaluation Criteria:

1. Functionality: The program meets the specified requirements and runs without errors.
2. Logic and Approach: The problem-solving approach is sound, and algorithms are appropriate.
3. Code Structure: The code is well-organized and efficient.
4. Documentation: Proper comments are included to explain key parts of the code.

Problem#1:Write a program in your preferred programming language to search for a


given element in an array. The program should ask the user to input the array's
elements and the value they want to search for. If the element is found, print the index
where it is located; otherwise, display a message that the element is not found.

Problem#2: Searching for an Element in an Array

You are given an array of integers, and your task is to write a program that searches
for a specific element in the array. Your program should prompt the user to input the
size of the array, the elements of the array, and the target element they want to search
for.

Requirements:

1. The program should first take an integer input for the size of the array.
2. It should then take the corresponding number of integer inputs as the array elements.
3. Finally, it should ask for the target element to be searched in the array.

Problem#3

You are given an array of integers, and your task is to write a program that inserts a
new element into a specific position in the array. The program should allow the user
to input the size of the array, the elements of the array, the element they want to insert,
and the position where the new element should be inserted.

Problem#4

Write a program that deletes an element from an array at a specific position. The
program should prompt the user to:

1. Input the size of the array.


2. Input the elements of the array.
3. Input the position from which the element should be deleted.

After deleting the element, print the updated array.

You might also like