COMPUTER APPLICATIONS- ASSIGNMENT
ONE DIMENSIONAL ARRAY- PROGRAMS
TO BE COMPLETED BY JANUARY 5th 2023
1. Write a program that creates integer array of 10 elements, accepts values
of arrays and then displays the values.
2. Write a program that creates integer array of p elements, accepts values of
arrays and print the array in reverse
3. Write a program that creates integer array of n elements, accepts values of
arrays and find the Sum and Average
4. Write a program that creates integer array of 10 elements, accepts values
of arrays and print only even numbers in the array. Also count the number
of even elements
5. Write a program that creates integer array of 10 elements, accepts values
of arrays and Find sum of all positive numbers and product of all negative
numbers
6. Write a program which takes in 10 values and creates another array which
has factorial of these values (or factorial) and prints both the arrays.
7. Write an array which takes in roll no and marks in 3 subjects for n students.
Print the roll no, total marks and % marks for all students.
8. Input price and quantity in 2 arrays . Calculate the amount. Find the net pay
Gst= 12% of amount & sales tax= 5% of amount and Gst
Discount=3.5% of amount.
9. Input your computer marks SEM 1 and SEM II and Internal Marks in three
arrays of 215 students appearing for the Board Exam. Find the total marks
of SEM 1 and SEM 2 of each student in another array TOT [ ] . Find the
average of your internal marks and TOT[ ]. Print all arrays
10. Input the name and age of 25 children in 2 arrays. Increment all ages by 25
and print the arrays.
11. WAP to input the basic salary of n employees in an array . Calculate the
total salary. Print a payslip for each employee in the given format:-
Payslip for the Month of January 2021
NAME BASIC DA HRA DAILY PROV FUND TAX NET PAY
----- ----- -- --- --- -------- --- -----
The details are given below:
DEARNESS Allowance = 20% of basic salary
House rent allowance = 10% of the basic salary
daily allowance = 3% of Dearness allowance and house rent
allowance
Provident fund = 9% of basic salary
Income tax = 3.5 % of basic salary
12. Input the names, date of maturity [mm/dd/yyyy], principal , rate and
term period of fixed deposits of n customers of a bank in separate arrays.
The Interest is compounded on an annual basis. Calculate the interest of
each customer. Find the total amount paid by the bank towards Interest.
Print a consolidated report [ all details ] of the fixed deposits of these n
customers.
13. Input the name, age and salary of 100 employees in separate arrays.
Increment the salary of all employees whose age above 50 years. Input any
name and print the details using linear search technique.
14. Input the name of the school, name of the student and their highest
mark in separate arrays. Arrange the arrays rank wise using bubble sort.
15. Input the country name and population of n countries in separate
arrays. Input the countries having population above 10 billion.
16. Input the car’s name, cost and speed in separate arrays of n brands
of cars. Input cost and print all details using binary search. Print the index
position and position in the array.
17. Input the name , date of joining and the years of experience of n
employees in separate arrays.
1. Count the number of employees having at least 10 years’ experience
2. Move the names of the employees with below 5 years experience to an
array x[ ] and print the array x[ ]
18. Input the name, price and quantity of 20 items in separate arrays. Find the
amount of each item. A discount of 3% is given for amount above Rs. 1000/- .
Find the amount for each item. Also find the net amount. Calculate the total
amount received as discount. Print a bill.
[Link] the item name, cost price and selling price. If GAIN then store the
item name in an array gain[ ] and if loss then push that item name in an
array loss[ ]. Print the arrays gain[ ] and loss [ ].
[Link] the name of the bowler and the number of wickets taken in separate
arrays. Print the name of the bowler who has taken the maximum and
minimum number of wickets.
Give the output:-
1) double [ ]s={12.5, 3.5,2.5,5};
for (int i=1;i<[Link]-1;i++)
s[i-1]=s[i++];
for (int i=0;i<[Link];i++)
[Link](s[i]);
2) int s[ ]={12,3,4,2,6,7};
for (int i=0;i<[Link]-1;i++)
s[++i]=s[i-1]++;
for (int i=0;i<[Link];i++)
[Link](s[i]);
3) int x[ ]={14,21,32};
x[1]=x[1+1];
x[0]+=x[2]-x[1]*x[0]/2;
x[2]++;
for (int i=0;i<[Link];i++)
[Link](x[i]+" ");
4) int x[]={5,4,9};
x[1]=x[1]*x[0]-x[2]/2;
x[1]*=x[3-2]-x[1*2]*x[0+3/2]/2;
--x[2];
for (int i=[Link]-1;i>=0;i--)
[Link](x[i]+" ");
5) Consider the array char p[ ] = {‘a’, ‘E’, ‘9’, ‘i’, ‘c’ };
What will be the output of the following?
i) [Link](p[2+2]);
ii) [Link](p[3]+5);
iii) [Link](p[1]+p[0]+” “ +p[2]+3);