0% found this document useful (0 votes)
541 views

Class 10 Computer Assignment

The document provides instructions for a computer programming class final project. Students are asked to complete 10 programs from the midterm along with 5 additional programs: 1) a linear search of a 1D array to find a number, 2) linear search to find a number and its position, 3) store and display the first 10 Fibonacci numbers in a 1D array, 4) search a 1D array of phone numbers using the first 4 digits entered, and 5) sort an array of 10 integers in ascending order using bubble sort and display the sorted array. It includes sample code for the bubble sort program.

Uploaded by

Mr FeaRYT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
541 views

Class 10 Computer Assignment

The document provides instructions for a computer programming class final project. Students are asked to complete 10 programs from the midterm along with 5 additional programs: 1) a linear search of a 1D array to find a number, 2) linear search to find a number and its position, 3) store and display the first 10 Fibonacci numbers in a 1D array, 4) search a 1D array of phone numbers using the first 4 digits entered, and 5) sort an array of 10 integers in ascending order using bubble sort and display the sorted array. It includes sample code for the bubble sort program.

Uploaded by

Mr FeaRYT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMPUTER APPLICATIONS

CLASS X

(For your Final submission of the Computer


Project)
All the 10 programs of the Half-Yearly along with the following 5 programs (4 programs were done in
the class and the one which is not done and explained is given here and will be explained in the next
class)

1. Write a program to accept 10 different numbers in a Single Dimensional Array. Now, enter a
number and search whether the number is present or not in the list of array elements by
using the Linear search technique. If the number is present then display the message
“Search Successful” otherwise, display “Search Unsuccessful”.

2. Write a program to accept 10 different numbers in a Single Dimensional Array. Now, enter a
number and search whether the number is present or not in the list of array elements by
using the Linear search technique. If the number is present then display the number and its
position in the array.

3. Write a program to store the first 10 terms of the Fibonacci series in a Single Dimension
Array (SDA) and display the series from the array.

4. Write a program to accept 10 mobile numbers in a Single Dimensional Array. Now, search
the phone numbers, using the first 4 digits entered by the user from the array elements and
display.

5. Write a program to accept a set of 10 integers in a Single Dimensional Array (SDA). Sort the
numbers in ascending order by using the ‘Bubble Sort’ technique. Display the sorted array.

import java.util.*;
class bubble
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int i, j,temp;
int arr[]=new int[10];
for(i=0;i<10;i++)
{
System.out.println("enter the data");
arr[i]=sc.nextInt();
}
System.out.println("the unsorted array is :-");
for(i=0;i<10;i++)
{
System.out.print(arr[i]+" ");
}
for(i=0;i<9;i++)
{
for(j=0;j<(9-i);j++)
{
if(arr[j]>arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
System.out.println();
System.out.println("the sorted array is :-");
for(i=0;i<10;i++)
{
System.out.print(arr[i]+" ");
}
}
}

You might also like