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

Assignment2 SDA Section B

Uploaded by

valorantopop69
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)
12 views1 page

Assignment2 SDA Section B

Uploaded by

valorantopop69
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

Grade 10

Assignment 2

Single Dimensional Section B Questions

1. Write a program to initialize an array with 10 random integers between 1 to 100. Sort them in an
ascending order using selection sort technique. Display the sorted array.

2. Write a program to store 15 double numbers in an array. Arrange these numbers in descending
order by Bubble sort. Print the sorted list.

3. Write a java program to accept an integer array SDA[ ] of size n . Also accept an integer findnum.
Use Linear Search technique to check if findnum is present in array SDA[ ]. If found display “Search
successful” else display “Number is missing”.

4. Define a class to declare an array Marks[ ] of size n of double datatype, accept the marks of
students into the array and perform the following:

• Calculate and print the average marks of the class.

• Find and print the highest and lowest score.

5. Write a program to accept 10 phone numbers in an array in ascending order. Accept a phone
number and search if it is already present in the entered list using binary search method. Display
appropriate messages when search is successful or unsuccessful.

6. Write a program to perform linear search on a list of integers given below, to search for an
element input by the user. If it is found display the element along with its position, otherwise display
the message "Search element not found".

65, 7, 54, 11, 15, 27, 30, 45, 89, 97.

You might also like